# Rspec Tests getting killed exactly at 10 minutes

**URL:** <https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892>\
**Category:** Bug Reports\
**Created:** [October 14, 2019, 2:35pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892 "2019-10-14T14:35:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhulford](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jhulford/32/15556_2.png) [@jhulford](https://discuss.circleci.com/u/jhulford)\
**Post date:** [October 14, 2019, 2:35pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/1 "2019-10-14T14:35:12Z")

</div>

I have a pretty simple build process for a Ruby on Rails project that’s running rspec (bundle exec rspec --require spec\_helper --format RspecJunitFormatter --out /tmp/circle-tests/rspec/rspec.xml --format progress $(circleci tests glob “spec/\*\*/\*\_spec.rb” | circleci tests split --split-by=timings) and it just started failing last Friday morning with a message that rspec ‘Too long with no output (exceeded 10m0s)’.

I figured someone committed a bad test or something like, but after investigating I found that wasn’t the case and even builds for branches that ran perfectly fine the previous day or two were now failing with this same issue - even after rerunning without cache. I ssh’ed into the machine and tail’ed the test.log and found that up until the exact point when the circle env killed the rspec process our tests were running and not hung on something. I then ran the build with ssh and ran the tests using the same seed and command that the build runs and that completed without issue too and generated all the expected rspec output (.ie a green period is output to the console per completed test case).

So now I’m wondering why all of a sudden our tests are getting killed at exactly the 10 minute mark when they’e still progressing through the test “script” and appear to actually still be generating output (as the console output from the build summary has thousands of periods in it - we have around 10K tests) when prior to Friday everything worked fine. As mentioned above, this happens for every builds, even those that I re-run that previously ran to completion without error.

I’m kind of stumped where to begin here as nothing appears to be wrong, yet the builds are getting killed. I can modify the timeout on the run command as a workaround, but I’d like to eventually set it back if I can figure out the issue.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [October 14, 2019, 3:39pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/2 "2019-10-14T15:39:46Z")

</div>

Steps have an individual timeout, see this post:

> [@CircleCI builds and runs some tests successfully but then freezes](https://discuss.circleci.com/t/circleci-builds-and-runs-some-tests-successfully-but-then-freezes/31243/2):
>
> Hey @samfuller01, There is a decent chance that you will require more than 4Gb of RAM and therefore need to enable the [resource\_class](https://circleci.com/docs/2.0/configuration-reference/#resource_class) setting to one with more memory (medium+, large). Before that, try lengthening the amount of time the job has before timing out by increasing the no\_output\_timeout limit: [https://circleci.com/docs/2.0/configuration-reference/#run](https://circleci.com/docs/2.0/configuration-reference/#run) The default is 10 minutes, give 20 a try. If that doesn’t work, feel free to open a ticket with support and we’ll be happy to check t…

---

<div class="post-metadata">

**Author:** ![jhulford](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jhulford/32/15556_2.png) [@jhulford](https://discuss.circleci.com/u/jhulford)\
**Post date:** [October 14, 2019, 4:10pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/3 "2019-10-14T16:10:01Z")

</div>

I increased the time on the command and our builds are running to completion now…but I’m not real clear why I needed to make that change. The rspec command I’m running **is** generating output to stdout the whole time it’s running. It prints a period to the console for every single test case completed - and it completed 4,000+ test before being killed by circle’s run command supervisor (I copied the output from the build report in the web app, so it’s definitely picking up the output too). So it’s not as if the job sat idle as the kill command seems to indicate, it’s printing out several periods every second the command is running.

Also, the fact that our build didn’t require the 20m timeout prior to last week is suspect too. Like I indicated in my initial report, if I re-run a build that ran without failure last Wednesday, the test command now gets killed on those builds as well, where it wasn’t killed initially.

I’m ok working with the adjusted 20m time, I’m just not following why it’s needed when the test command is generating output and the command timeout wasn’t an issue prior to last week Friday.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [October 14, 2019, 6:29pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/4 "2019-10-14T18:29:03Z")

</div>

You’re welcome 😀

I agree with your analysis. Raise a bug report by sending a message to `support@circleci.com`, and an engineer will look at it.

---

<div class="post-metadata">

**Author:** ![wktk](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/wktk/32/23390_2.png) [@wktk](https://discuss.circleci.com/u/wktk)\
**Post date:** [October 15, 2019, 7:00am UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/5 "2019-10-15T07:00:56Z")

</div>

I have the same issue. Changing `--format progress` to `--format documentation` worked for me.  
It looks the behavior of stdout buffer has changed and jobs timeout when there’s no line-breaks for 10 minutes?

---

<div class="post-metadata">

**Author:** ![amleaver](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/amleaver/32/23397_2.png) [@amleaver](https://discuss.circleci.com/u/amleaver)\
**Post date:** [October 15, 2019, 3:28pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/6 "2019-10-15T15:28:08Z")

</div>

I’ve started seeing the same issue but with a minitest test suite. I’ve seen this happen very intermittently in the past but as of today it has happened on 7 out of 14 builds.

---

<div class="post-metadata">

**Author:** ![jhulford](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jhulford/32/15556_2.png) [@jhulford](https://discuss.circleci.com/u/jhulford)\
**Post date:** [October 15, 2019, 3:42pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/7 "2019-10-15T15:42:36Z")

</div>

@wktk @amleaver Thanks for confirming the issue. I sent a bug report to Circle support referencing this post.

---

<div class="post-metadata">

**Author:** ![jhulford](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jhulford/32/15556_2.png) [@jhulford](https://discuss.circleci.com/u/jhulford)\
**Post date:** [October 15, 2019, 5:10pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/9 "2019-10-15T17:10:06Z")

</div>

Sorry, it wasn’t my intention to snub you. @halfer I appreciate the assistance.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [October 15, 2019, 5:19pm UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/10 "2019-10-15T17:19:04Z")

</div>

Thanks @jhulford - appreciated! 👍

---

<div class="post-metadata">

**Author:** ![glenjamin.circleci](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@glenjamin.circleci](https://discuss.circleci.com/u/glenjamin.circleci)\
**Post date:** [October 18, 2019, 6:34am UTC](https://discuss.circleci.com/t/rspec-tests-getting-killed-exactly-at-10-minutes/32892/11 "2019-10-18T06:34:13Z")

</div>

Thanks for raising this - the issue was caused by an edge case we had overlooked when rolling out our [new secrets masking implementation](https://circleci.com/blog/keep-environment-variables-private-with-secret-masking/).

We’ve toggled it off for now and will get this sorted before continuing our rollout.
