# Test timings can't be found

**URL:** <https://discuss.circleci.com/t/test-timings-cant-be-found/33702>\
**Category:** Build Environment\
**Created:** [December 12, 2019, 11:21am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702 "2019-12-12T11:21:25Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![typhoon2099](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/typhoon2099/32/24242_2.png) [@typhoon2099](https://discuss.circleci.com/u/typhoon2099)\
**Post date:** [December 12, 2019, 11:21am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/1 "2019-12-12T11:21:25Z")

</div>

I’m using RSpec in parallel and splitting by test timings. Recently the timings have stooped working (I’m not sure how far back, but at least the last week. I get output like the following:  
TESTFILES=$(circleci tests glob “./spec/\*\*/\*\_spec.rb” | circleci tests split --split-by=timings --timings-type=classname)  
echo $TESTFILES  
bundle exec rspec   
–format RspecJunitFormatter   
–out ./coverage/xml/rspec/rspec.xml   
–format progress   
– $TESTFILES

```
No timing found for "spec/api/api_constraints_spec.rb"
No timing found for "spec/application_spec.rb"
...

```

I have checked the stored test result XML (stored as an artifact for debugging) and they are indeed there, but CircleCI seems to not be finding them. The only thing that I can see that might be causing this is that the paths in the XML file start with `./`, which is not present in the warning messages (nor the output of `circleci tests glob`).

Has something changed that I’ve missed?

---

<div class="post-metadata">

**Author:** ![danadaldoss](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/danadaldoss/32/23856_2.png) [@danadaldoss](https://discuss.circleci.com/u/danadaldoss)\
**Post date:** [December 20, 2019, 6:47pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/2 "2019-12-20T18:47:53Z")

</div>

I’m seeing the same thing on an Elixir app. Timings/parallelization was working fine until a few weeks ago.

What version of CI are you using? We’re using v2 (not v2.0) and not workflows, and I think that might have something to do with it.

---

<div class="post-metadata">

**Author:** ![typhoon2099](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/typhoon2099/32/24242_2.png) [@typhoon2099](https://discuss.circleci.com/u/typhoon2099)\
**Post date:** [January 6, 2020, 11:10am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/3 "2020-01-06T11:10:57Z")

</div>

We’re using v2.1 with workflows.

---

<div class="post-metadata">

**Author:** ![IceCreamYou](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/icecreamyou/32/21533_2.png) [@IceCreamYou](https://discuss.circleci.com/u/IceCreamYou)\
**Post date:** [January 13, 2020, 2:54am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/4 "2020-01-13T02:54:42Z")

</div>

We are experiencing the same issue.

---

<div class="post-metadata">

**Author:** ![mcbuddy](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mcbuddy/32/23996_2.png) [@mcbuddy](https://discuss.circleci.com/u/mcbuddy)\
**Post date:** [January 13, 2020, 10:05pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/5 "2020-01-13T22:05:02Z")

</div>

Do anyone has a solution for this `No timing found` issue?  
We are experiencing the same issue since last month and for the info, we use version 2.1 with workflow, after investigation and using this [validator](https://github.com/levlaz/circleci-test-results-validator) got a lot of error. We did not change our formatting and it was working fine until last month approx. Dec 6, 2019 is the last time we check after that we got that issue.

---

<div class="post-metadata">

**Author:** ![mlukjanska25f](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@mlukjanska25f](https://discuss.circleci.com/u/mlukjanska25f)\
**Post date:** [January 14, 2020, 2:20pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/6 "2020-01-14T14:20:31Z")

</div>

We are also trying to figure out why we are getting

```
No timing found for "tests/integration/reckonhosted/DemoTestSet1Test.php"
No timing found for "tests/integration/reckonhosted/DemoTestSet1_1Test.php"

```

The command that we use for splitting the tests is the following (debugging one):

```
#!/bin/bash -eo pipefail
circleci tests split --split-by=timings --timings-type=classname --show-counts tests/integration/_circleci_tests_list.txt | xargs -n 1 echo

```

I am trying to experiment by removing the ‘–timings-type=classname’, since we are passing the list of path/filename. Guessing that maybe that’s the issue, but not sure.

Nope, this did not help with No timing issue.

We are using  
config version: 2.1  
workflows:  
version: 2

---

<div class="post-metadata">

**Author:** ![mcbuddy](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mcbuddy/32/23996_2.png) [@mcbuddy](https://discuss.circleci.com/u/mcbuddy)\
**Post date:** [January 15, 2020, 3:45pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/7 "2020-01-15T15:45:03Z")

</div>

Alright, we actually found the issue from the JUnit report that Cucumber generated by default. As we can see from the doc [here](https://relishapp.com/cucumber/cucumber/docs/formatters/junit-output-formatter) the XML as following:

```auto

<?xml version="1.0" encoding="UTF-8"?>
<testsuite failures="0" errors="0" skipped="2" tests="2" time="0.05" name="Pending step">
  <testcase classname="Pending step" name="Pending" time="0.05">
    <skipped/>
      <system-out/>
    <system-err/>
  </testcase>
  <testcase classname="Pending step" name="Undefined" time="0.05">
    <skipped/>
    <system-out/>
    <system-err/>
  </testcase>
    <system-out>
      <![CDATA[]]>
    </system-out>
    <system-err>
      <![CDATA[]]>
    </system-err>
</testsuite> 

```

Using the [validator](https://github.com/levlaz/circleci-test-results-validator) that I mention in the previous comment. We found that some of the tags causing this issue on the circle-ci such as `<![CDATA[]]>` , `<system-out/>` , etc.

So we created custom JUnit that makes CircleCI happy about and it works. For the reference of how the XML format should be, please see [this StackOverflow threads](https://stackoverflow.com/questions/4922867/what-is-the-junit-xml-format-specification-that-hudson-supports) something like this:

```auto
<testsuites>
  <testsuite>
    <properties>
      <property> ... </property>
    </properties>

    <testcase> ... </testcase>
  </testsuite>
</testsuites>

```

Hope this can be helpful for those have similar issue like us.

---

<div class="post-metadata">

**Author:** ![typhoon2099](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/typhoon2099/32/24242_2.png) [@typhoon2099](https://discuss.circleci.com/u/typhoon2099)\
**Post date:** [January 15, 2020, 4:27pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/8 "2020-01-15T16:27:34Z")

</div>

I can confirm that RSpec and Karma is producing output similar to your Cucumber output. This sounds like CircleCI isn’t supporting the JUnit XML format properly (rather than three different test suites not supporting the format correctly).

---

<div class="post-metadata">

**Author:** ![BernardoSilva](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/bernardosilva/32/24051_2.png) [@BernardoSilva](https://discuss.circleci.com/u/BernardoSilva)\
**Post date:** [January 24, 2020, 9:30am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/9 "2020-01-24T09:30:58Z")

</div>

Having the same problem.  
Timings from our E2E that generate a junit xml report are not being picked up =/

---

<div class="post-metadata">

**Author:** ![darrikonn](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/darrikonn/32/23229_2.png) [@darrikonn](https://discuss.circleci.com/u/darrikonn)\
**Post date:** [January 28, 2020, 11:20am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/10 "2020-01-28T11:20:32Z")

</div>

Any news on this CircleCI!?

---

<div class="post-metadata">

**Author:** ![mlukjanska25f](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@mlukjanska25f](https://discuss.circleci.com/u/mlukjanska25f)\
**Post date:** [February 7, 2020, 11:20am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/11 "2020-02-07T11:20:17Z")

</div>

For us in the end the issue was that CircleCI was expecting relative paths to tests in the xml report, but our report had absolute paths (kudos to [Split by timing parallelism does not seem to balance out](https://discuss.circleci.com/t/split-by-timing-parallelism-does-not-seem-to-balance-out/26994/4)).

The message that the CircleCi was giving for splitting:

 ![image](https://global.discourse-cdn.com/circleci/original/3X/3/5/35186fa17b5b15aa7083e78b9bcfd3439f4a9264.png)

So it looks that internally they store something like  
`tests/integration/NameOfTest.php`

In our xml report it was the absolute path (/root/project/…):

 ![image](https://global.discourse-cdn.com/circleci/original/3X/0/d/0d08a1aadac46c4aa3bacbafdeaae43f04094c78.png)

Once we cleaned up the report using the command below to remove the absolute part before storing it as test result/artifact, the timings started to be autodetected:  
`command: sed -i 's/\/root\/project\///g' tests/_output/integration/result.xml`

Here how our test splitting started to look like after:

 ![image](https://global.discourse-cdn.com/circleci/original/3X/1/9/19985b1d446a5f39be947dee9df8ab9c20553354.png)

Note: We are not using flag `--timings-type=classname` and feeding the list of tests from the file. So the command looks something like this:  
`command: circleci tests split --split-by=timings --show-counts tests/integration/_circleci_tests_list.txt | xargs -n 1 echo`

---

<div class="post-metadata">

**Author:** ![typhoon2099](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/typhoon2099/32/24242_2.png) [@typhoon2099](https://discuss.circleci.com/u/typhoon2099)\
**Post date:** [February 21, 2020, 10:53am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/12 "2020-02-21T10:53:48Z")

</div>

The paths in my spec files aren’t absolute, they’re relative to the project root. The only think I can see that may be preventing the timings from being used is the fact that the paths start with `./`.

---

<div class="post-metadata">

**Author:** ![typhoon2099](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/typhoon2099/32/24242_2.png) [@typhoon2099](https://discuss.circleci.com/u/typhoon2099)\
**Post date:** [February 21, 2020, 11:40am UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/13 "2020-02-21T11:40:42Z")

</div>

I’ve just tried stripping off the `./` using `sed -i 's/\.\///g' ./coverage/xml/rspec/rspec.xml` and still get the “No timing found” messages all over the place. I’m running RSpec using:

```auto
TESTFILES=$(circleci tests glob "./spec/**/*_spec.rb" | circleci tests split --split-by=timings --timings-type=classname)
bundle exec rspec \
  --format RspecJunitFormatter \
  --out ./coverage/xml/rspec/rspec.xml \
  --format progress \
  -- $TESTFILES

```

---

<div class="post-metadata">

**Author:** ![jaysonesmith](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jaysonesmith/32/24247_2.png) [@jaysonesmith](https://discuss.circleci.com/u/jaysonesmith)\
**Post date:** [February 24, 2020, 6:48pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/15 "2020-02-24T18:48:28Z")

</div>

I ran into a couple of these and it turns out one file was completely commented out and another was a helper file that happened to end in \_spec.rb. Might be worth looking into the files that are being reported for similar stuff.

If that doesn’t help, you can check the stored test\_results by SSH’ing into one of the containers and checking the file there.

`cat /.circleci-task-data/circle-test-results/results.json | jq '.tests[] | .file' | grep {file}`

---

<div class="post-metadata">

**Author:** ![jaysonesmith](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jaysonesmith/32/24247_2.png) [@jaysonesmith](https://discuss.circleci.com/u/jaysonesmith)\
**Post date:** [February 25, 2020, 5:48pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/16 "2020-02-25T17:48:49Z")

</div>

While I’ve got things working for rspec and cypress, I’m still running into issues with Cucumber.

---

<div class="post-metadata">

**Author:** ![billy1kaplan](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/billy1kaplan/32/23299_2.png) [@billy1kaplan](https://discuss.circleci.com/u/billy1kaplan)\
**Post date:** [March 6, 2020, 8:17pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/17 "2020-03-06T20:17:13Z")

</div>

Did anyone figure out how to get this working for rspec?

At a random point in the middle of December (with no circleci changes on our end as far as we can tell), every run of our circleci pipeline has the No timing found for… message for every file in the test suite.

---

<div class="post-metadata">

**Author:** ![aharbick](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/aharbick/32/25101_2.png) [@aharbick](https://discuss.circleci.com/u/aharbick)\
**Post date:** [June 8, 2020, 7:45pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/18 "2020-06-08T19:45:58Z")

</div>

@jaysonesmith’s answer helped me figure out that `--timings-type=classname` just doesn’t work.

```
circleci@707b3358e4a1:~/bw_rails$ echo "test/api/api_test.rb" | circleci tests split --timings-file /.circleci-task-data/circle-test-results/results.json --split-by=timings --timings-type=classname
No timing found for "test/api/api_test.rb"
test/api/api_test.rb
circleci@707b3358e4a1:~/bw_rails$ echo "test/api/api_test.rb" | circleci tests split --timings-file /.circleci-task-data/circle-test-results/results.json --split-by=timings
Autodetected filename timings.
test/api/api_test.rb

```

I was uploading the results correctly… but classname timings type was messing things up.

---

<div class="post-metadata">

**Author:** ![mike](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mike/32/24230_2.png) [@mike](https://discuss.circleci.com/u/mike)\
**Post date:** [July 13, 2020, 10:28pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/19 "2020-07-13T22:28:23Z")

</div>

To add to @aharbick’s comment about `--timings-type=classname`.

`--timings-type=classname` expects a list of _class names_ not _file names_ to be passed in. So if you are using `circleci tests glob` you will likely never want to use `--timings-type=classname`.

To make the point more clearly. `circleci tests split` simply takes in a list of strings and then tries to match them to the values that were originally in the test results file. So to give an example `testcase` line from a jUnit XML file

```auto
<testcase classname="MyClass" name="should access project data" file="tests/TestMyClass.java"/>

```

`circleci tests split` will simply look at the value in `classname` if you pass in `--timings-type=classname`. This is why this will never work if you pass in a list of file names. To use `--timings-type=classname` you want to have a method of creating a list of _class names_ and not actually use the `circleci tests glob` command. The vast majority of use-cases will only make use of `--timings-type=filename` which is also the default if you leave it off.

Hope that helps clear up some of the confusion.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [July 23, 2020, 10:34pm UTC](https://discuss.circleci.com/t/test-timings-cant-be-found/33702/20 "2020-07-23T22:34:19Z")

</div>

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