Requested historical based timing, but they are not present

Hi there,

I’m running tests on a Django app and have successfully parallelized the tests, but I want to improve it even further by saving the timing data. However, all the options I’ve tried keep returning with:

Requested historical based timing, but they are not present. Falling back to name based sorting

The previous similar discussions were not useful and while I am doing this within a workflow, it seems like that should no longer be the issue.

The relevant section of my config.yml file is:

- run:
    name: "Run tests"
    command: |
      TESTFILES=$(circleci tests split ~/app/test_filenames.txt --split-by=timings --timings-type=classname)
      # Run tests ...
- store_test_results:
    path: ~/app/test-results/backend-tests

And the lines in test_filenames.txt file are of the classname form (e.g. accounts.tests).
Is there some crucial step that I am missing here?

Any help would be greatly appreciated.

All the best,
Oisín

What is the directory structure look like under ~/app/test-results/backend-tests?
Is it like this: https://circleci.com/docs/2.0/configuration-reference/#example-6

test-results
├── jest
│   └── results.xml
├── mocha
│   └── results.xml
└── rspec
    └── results.xml

If your store_test_results is correct, my second guess is that the classnames from the test XML files and the lines of strings you’ve passed to split are not matching.

Error reading historical timing data: file does not exist
Requested weighting by historical based timing, but they are not present. Falling back to weighting by name.

My many many (many) tries have resulted in that error 100% of the time.

I have a prior job step that has run:
- store_test_results:
path: test-results

with console output:
Archiving the following test results

  • /root/app/test-results/junit/test-results.xml

Uploaded

So where does the file actually need to go then?

I have a visible Test Summary table up above etc.

1 Like

This maybe a problem with the XML file, could you share the results?

if it’s secret could you share a sample including all of the headers.

I think I discovered my issue. My test-results.xml, the classname= was a Browser name/type and the name: was the name of the test.

Thus – none of those are “filenames” it can go find.

Going to see if I can write a custom test reporter to make the name: be the true file path

1 Like