Skip to content

Fix flaky spec in elections' key ceremony#8796

Merged
andreslucena merged 4 commits intodevelopfrom
test/fix-flaky-key-ceremony
Feb 22, 2022
Merged

Fix flaky spec in elections' key ceremony#8796
andreslucena merged 4 commits intodevelopfrom
test/fix-flaky-key-ceremony

Conversation

@andreslucena
Copy link
Copy Markdown
Member

@andreslucena andreslucena commented Feb 9, 2022

🎩 What? Why?

Lately we've seen a lot of flaky specs with this example in decidim-elections. This PR fixes that.

I think this is for two reasons:

  • First, as there's AJAX involved, we're trying to interact with the button before it exists. We should wait so it exists. This fixes some fails but not 100% of them.
  • Second, decidim-elections needs to interact with an external app, decidim-bulletin-board. For working in CI, this app has the DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL that as its name says, allows specs from decidim-elections to truncate the DB before some specs. This doesn't seems to play nicely with paralell specs from Add parallel_tests for test suite in CI #8678, as on this particular spec that it's a slow one, the DB is changed by the other parallel process (or at least that's my current theory). This seems to fix 100% of cases. I couldn't check this locally as

I've rerun this last case 10 times and it's always green:

image

The tradeoff is that we're losing parallel specs in this case, but I don't see a way of making parallels specs work with the DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL logic. According to the checks that I've seen, we'll go from 22 to 35 minutes of execution on average on this workflow.

📌 Related Issues

Testing

The "[CI] Elections (system public)" is green multiple reruns.

📷 Screenshots

Before this PR:

Selection_002

(6 from the last 13 commits are in red because of the failure of this flaky)

♥️ Thank you!

@andreslucena andreslucena added flaky spec module: elections type: internal PRs that aren't necessary to add to the CHANGELOG for implementers labels Feb 22, 2022
@andreslucena andreslucena merged commit 4efb69a into develop Feb 22, 2022
@andreslucena andreslucena deleted the test/fix-flaky-key-ceremony branch February 22, 2022 13:35
@alecslupu alecslupu added this to the 0.27.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky spec module: elections type: internal PRs that aren't necessary to add to the CHANGELOG for implementers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky spec in key_ceremony_spec.rb (elections)

2 participants