# RSpec tests time out after upgrading to ruby 2.6.x

**URL:** <https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547>\
**Category:** Running Tests\
**Tags:** 2.0, rails, rspec\
**Created:** [February 22, 2019, 8:22am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547 "2019-02-22T08:22:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![pacso](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pacso/32/21487_2.png) [@pacso](https://discuss.circleci.com/u/pacso)\
**Post date:** [February 22, 2019, 8:22am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/1 "2019-02-22T08:22:03Z")

</div>

I have a test suite which is currently running perfectly with Ruby 2.5.3.

I have a branch to update the version of Ruby to 2.6.1. In this branch all of the tests pass successfully, and the test output is identical to that of the 2.5.3 branches. However, after completing the tests with Ruby 2.6.1, things just hang and eventually time out after 10 minutes.

The end of the RSpec tests in the log look like this:

```
Finished in 7 minutes 37 seconds (files took 3.28 seconds to load)
513 examples, 0 failures, 2 pending

RSpec is shutting down and will print the summary report... Interrupt again to force quit.
Too long with no output (exceeded 10m0s)

```

I’ve run the tests manually on the CircleCI image over SSH and get the same behaviour with the tests not exiting once completed. Running them on my local machine does not provide the same behaviour though, they complete normally here.

After upgrading to Ruby 2.6.x is there something else I should be changing on the CircleCI config in order to get these to work properly?

---

<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:** [February 22, 2019, 10:57am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/2 "2019-02-22T10:57:03Z")

</div>

Is your version of RSpec exactly the same, or was that upgraded too?

---

<div class="post-metadata">

**Author:** ![pacso](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pacso/32/21487_2.png) [@pacso](https://discuss.circleci.com/u/pacso)\
**Post date:** [February 22, 2019, 11:03am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/3 "2019-02-22T11:03:14Z")

</div>

Yep - identical. No changes other than the version of Ruby.

Image wise, I’ve switched from `circleci/ruby:2.5.3-node-browsers` to `circleci/ruby:2.6.1-node-browsers`

---

<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:** [February 22, 2019, 11:35am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/4 "2019-02-22T11:35:34Z")

</div>

I’ve no experience with Ruby, so just chucking ideas in the pot. Can you write the simplest possible test (true === true) in RSpec and replicate this issue in a separate repo? If that hangs then I’d regard it as an RSpec bug.

Are you doing any headless browser testing in RSpec that would require some complicated/slow shutdown?

---

<div class="post-metadata">

**Author:** ![pacso](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pacso/32/21487_2.png) [@pacso](https://discuss.circleci.com/u/pacso)\
**Post date:** [February 22, 2019, 11:37am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/5 "2019-02-22T11:37:36Z")

</div>

Well, here’s the thing. If I run a subset of the tests on the command line they pass and complete correctly. If I run the entire test suite on the command line it hangs after the tests finish.

So, something is causing it to hang, and I very much doubt it’s the fault of RSpec. The strange thing is that it doesn’t happen when using Ruby 2.5.3.

---

<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:** [February 23, 2019, 1:17pm UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/6 "2019-02-23T13:17:22Z")

</div>

Here’s an earlier question 🙂

> [@halfer](#):
>
> Are you doing any headless browser testing?

---

<div class="post-metadata">

**Author:** ![pacso](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pacso/32/21487_2.png) [@pacso](https://discuss.circleci.com/u/pacso)\
**Post date:** [February 25, 2019, 6:04am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/7 "2019-02-25T06:04:39Z")

</div>

Yes, using chrome, capybara/selenium

---

<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:** [February 25, 2019, 8:01am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/8 "2019-02-25T08:01:04Z")

</div>

Does RSpec have a verbose/debug mode that can give you a more accurate idea of what it is doing?

---

<div class="post-metadata">

**Author:** ![pacso](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pacso/32/21487_2.png) [@pacso](https://discuss.circleci.com/u/pacso)\
**Post date:** [February 25, 2019, 9:10am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/9 "2019-02-25T09:10:48Z")

</div>

Not that I’m aware of. The most detailed output is the documentation formatter, but there aren’t any RSpec errors reported. As I said, the test suite completes successfully, but RSpec hangs and doesn’t shut down.

I’ve just run the test suite again with SSH enabled, and managed to get it to complete successfully by killing the following process:

```
/bin/sh /usr/bin/xdg-open /home/circleci/<project_name>/tmp/capybara/capybara-201902250901525185555611.html

```

The content of that file was the HTML from the last system test executed. Nothing strange content wise. It just seems that on the final test, capybara just hangs around waiting for more instructions.

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [February 25, 2019, 1:43pm UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/10 "2019-02-25T13:43:48Z")

</div>

I’m not the best at ruby either, but I know I’ve seen related issues on javascript. Are you telling selenium to shut down the browser after the test suites? If that’s not happening I can see rspec possibly getting stuck waiting for it to return.

Another thing you can try is using VNC and SSH to watch the tests and see exactly what’s happening [https://circleci.com/docs/2.0/browser-testing/#interacting-with-the-browser-over-vnc](https://circleci.com/docs/2.0/browser-testing/#interacting-with-the-browser-over-vnc)

---

<div class="post-metadata">

**Author:** ![pacso](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pacso/32/21487_2.png) [@pacso](https://discuss.circleci.com/u/pacso)\
**Post date:** [February 25, 2019, 2:39pm UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/11 "2019-02-25T14:39:42Z")

</div>

No - I’m not specifically telling it to shut down. I’ve never had to do that before. These tests are working fine with Ruby 2.5.3.

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [February 25, 2019, 2:47pm UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/12 "2019-02-25T14:47:58Z")

</div>

I recommend the SSH/VNC path then. Something seem to have changed between 2.5 and 2.6, but I don’t know would it would be.

I’m not aware of any changes between those two images besides the ruby version, you can view the Dockerfiles used to create them here [https://github.com/CircleCI-Public/circleci-dockerfiles/tree/master/ruby/images](https://github.com/CircleCI-Public/circleci-dockerfiles/tree/master/ruby/images)

---

<div class="post-metadata">

**Author:** ![pacso](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/pacso/32/21487_2.png) [@pacso](https://discuss.circleci.com/u/pacso)\
**Post date:** [February 26, 2019, 8:50am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/13 "2019-02-26T08:50:44Z")

</div>

OK - so I managed to get VNC working and watched everything running on the server. For some reason one of my tests was spitting out a screenshot, which was holding the browser window open and causing the tests to time out.

Very strange that this wasn’t a problem on Ruby 2.5.3 to be honest, as that is showing the same behaviour but just not hanging at the end.

In any case … I’ve rewritten the troublesome test and all is now good in Ruby 2.6.1.

Thank you both for your help!

---

<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:** [March 8, 2019, 8:56am UTC](https://discuss.circleci.com/t/rspec-tests-time-out-after-upgrading-to-ruby-2-6-x/28547/14 "2019-03-08T08:56:13Z")

</div>

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