Error: "Requested historical based timing, but they are not present"


#1

When we try to split the tests based on timing:

circleci tests glob **/tests/*.py | circleci tests split --split-by=timings | xargs python -m pytest --reuse-db --junitxml=test_results/results.xml

We get te following error: Requested historical based timing, but they are not present. Falling back to name based sorting

We also have the store_test_results step setup after the tests are completed:

  * /os-core/test_results
Uploaded ```

Any suggestion on how to fix it?

Problem using split by timings in Workflows
#2

+1 to this, I’m also having the same issue with my team’s workflow tests.

We use the store_test_results step, but regardless it seems the next run emits the same error.

I believe there’s some information missing from the documentation.

The timings split type uses historical timing data to weight the split. CircleCI automatically makes timing data from previous runs available inside your container in a default location so the CLI tool can discover them (/.circleci-task-data/circle-test-results/).

On my build containers, though, there’s nothing:

root@01f98b1f8169:/.circleci-task-data# ls -alh
total 8.0K
drwxr-xr-x  2 root root 4.0K Jul 11 23:00 .
drwxr-xr-x 57 root root 4.0K Jul 11 23:01 ..

Private build for reference: https://circleci.com/gh/bellycard/core-service/3687


#3

Ran into this same issue.

According to https://circleci.com/docs/2.0/configuration-reference/#store_test_results the store_test_results key is not supported with Workflows, and that’s why I was unable to get it working.


#4

Thanks to CircleCI support I found that the fix is to add --timings-type=classname.
I am not entirely sure why this was the issue since results.xml has the file names. I suggested Circle improve the error message not to state that the file is not present

Full command:
- run: circleci tests glob "**/test*.py"| circleci tests split --split-by=timings --timings-type=classname | xargs python -m pytest --reuse-db --junitxml=test_results/results.xml


#5

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.


#6

We have released support for timing-based test splitting within Workflows. Timing data will be made available from the most recent job (within the last 50) with the same job name.