Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Rspec formatter suddenly and intermittently stops output to STDOUT #1520

@synth

Description

@synth

I just spent 3 days debugging this, and I'm still not sure what's going on, but here's the story:

The symptom is that my rspec feature suite(using capybara-webkit) would run and just stop suddenly and randomly somewhere in the suite. I would see a bunch of a passing "."'s and then all of a sudden the shell prompt with no other output. It seemed like the process was dieing for some reason. But then I realized that at a certain point, the output would stop but the test.rb logs would keep going. I thought I was in some infinite redirect loop or something, and after 3 days, I finally realized the tests were completing it was just the output that was stopping.

I then changed my test suite to output to a file and through tailing the file, I could see all the output and see my tests fully passing. This occurs with every formatter available in rspec-core(json, progress, html, etc).

What's weird about this issue is that I feel it has something to do with threading or a race condition. Our application has some pages that load in content blocks asynchronously, we call these "pagelets"(a la facebook's pagelet architecture). Some pages load in multiple pagelets, each via an ajax call. The symptom of losing output only occurs on tests that visit a page that load in multiple pagelets. Pages that load in only one pagelet do not experience this issue.

Additionally, the issue does not occur when running an individual test in isolation, but only when in suite and occurs a different points in the suite randomly.

As I said, the workaround is to output to a file, but it'd be nice to understand what's really going on here and fix this properly.

Another fact, is that this was noticed after upgrading my application from rails 3.2.17 to 4.1.0. By doing this, rspec was also upgraded, although seemingly minor(see below)

Previous working versions:

rspec (2.14.1)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
rspec-mocks (2.14.4)
rspec-rails (2.14.1)
capybara (2.2.1)
capybara-webkit (1.1.0)

Current wonky versions

rspec (2.14.1)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
rspec-mocks (2.14.6)
rspec-rails (2.14.2)
capybara (2.1.0)
capybara-webkit (~> 1.1.1)!

I realize this is super difficult to assess, but maybe someone has some particular knowledge or good questions that I can go and continue to diagnose this super weird behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions