Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed flaky spec: missing comment on legislation annotation #2455

Conversation

raul-fuentes
Copy link
Contributor

Where

What

Fix flaky spec, rspec ./spec/features/comments/legislation_annotations_spec.rb:139

How

Explained in the related PR.

Screenshots

There aren't

Test

Explained in the related PR

Deployment

Nothing to apply

Warnings

Nothing to apply

@raul-fuentes raul-fuentes changed the title changed test, fixed variable instead os us the let option Backport PR # 1180 from Madrid's fork Feb 8, 2018
@raul-fuentes raul-fuentes changed the title Backport PR # 1180 from Madrid's fork Fix flacky: coded variables instead of relying on let variables on legislation annotation comments Feb 9, 2018
@raul-fuentes raul-fuentes changed the title Fix flacky: coded variables instead of relying on let variables on legislation annotation comments Fixed flaky spec: missing comment on legislation annotation Feb 9, 2018
@bertocq bertocq merged commit 8ca61e4 into consuldemocracy:master Feb 9, 2018
@aitbw aitbw deleted the backport_1180_flaky_commenting_legislation_questions branch February 9, 2018 14:23
clairezed pushed a commit to CDJ11/CDJ that referenced this pull request Jun 26, 2018
…0_flaky_commenting_legislation_questions

Fixed flaky spec: missing comment on legislation annotation
@javierv
Copy link
Contributor

javierv commented Jul 2, 2018

@raul-fuentes @bertocq I've just seen this test fail on my machine on the master branch; could it be possible that it still happens sometimes? Sorry to bring bad news!

EDIT: confirmed on my machine this test fails once in a while, with the same frequency as failures 2 and 3 mentioned in a hunt flaky test comment.

I think it might be related to postgresql fetching the comments in random order, like it happened with emails in #2695. The test looks for the last comment shown on the page, but that doesn't have to be the last comment created (which is what the test expects). This behaviour is hinted by the failure message:

expected to find text "Built with http:https://rubyonrails.org/" in "Manuela582 • Author • 2018-01-30 23:28:26 a comment No votes | I agree 0 I disagree 0 No responses"

Note "a comment" is the text of the other comment created during the test.

@raul-fuentes Do you think this could be the reason why this test still fails sometimes?

@javierv
Copy link
Contributor

javierv commented Jul 6, 2018

@raul-fuentes @bertocq Here's a recent build showing one of the mentioned failures: https://travis-ci.org/javierv/consul/jobs/400994553

  1) Commenting legislation questions Sanitizes comment body for security
     Failure/Error: expect(page).to have_content "click me http:https://www.url.com"
       expected to find text "click me http:https://www.url.com" in "Manuela3027 • Author • 2018-07-06 21:18:22 a comment No votes | I agree 0 I disagree 0 No responses"
     # ./spec/features/comments/legislation_annotations_spec.rb:164:in `block (3 levels) in <top (required)>'
     # ./spec/features/comments/legislation_annotations_spec.rb:163:in `block (2 levels) in <top (required)>'

Just like the other test, the text "a comment" appears where the expected comment was supposed to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants