question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Failing or flaky tests when run in parallel

See original GitHub issue

Context:

  • Playwright Version: [what Playwright version do you use?]
  • Operating System: Mac
  • Node.js version: 16.14.0
  • Browser: Chrome

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:

// our test file
test.describe.configure({ mode: 'parallel' })

// playwright.config.ts

{
  workers: 3
}

We have an issue potentially and a question, the potential issue we’re seeing is whenever we run in parallel mode we’re getting failures in which normally running in 1 worker will have all the tests passing consistently. We’ve tested this in a couple ways:

  1. running our suite with 3 workers (running each file through a process)
  2. running a single test file and configuring to run each test case to run in parallel

The results are the same, we get some cases that fail that normally don’t under 1 worker. Additionally, when we’re running a single file in parallel we noticed the time it takes to run the file doesn’t seem to improve:

File run in parallel with 3 workers: Screen Shot 2022-03-16 at 9 59 58 AM

File run not in parallel with 1 worker: Screen Shot 2022-03-16 at 9 50 37 AM

If we compare the screen shots, the screen shot with all the passing test (1 worker) has a total run time of 4.0m, theoretically it (3 workers) should cut the run time down to ~1/3 or 1.3m. However, looking at the screen shot with the flaky case (run single file in parallel with 3 workers) which adds an extra 1.1 min, if we took away the additional time caused by the flaky case, it would still be around 4m or so for the entire file to run? Any help would greatly be appreciated, thank you!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tanmdoancommented, Mar 21, 2022

Hi @dgozman thank you so much for checking in on this. Turns out the extra workers hangs when using the same credentials, going to file an issue with our auth team to see if it’s something on our side. Will create another issue if needed once we do some debugging internally.

Thanks again!

0reactions
jamalebp-formantcommented, Jun 17, 2022

Has anyone figured out whats going on with flaky tests or ways to debug the tests? I’ve seen via trace that my tests are failing isVisible() when its clearly visible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Flaky Tests - Semaphore CI
Flaky tests hinder development, slow down progress, hide design problems, and can cost a lot of money in the long run.
Read more >
Too many parallel test processes may amplify flaky tests
If you have issues with flaky tests, reducing the number of parallel processes may help.
Read more >
How to reduce flaky test failures - CircleCI
Flaky tests, also known as flappers, fail to produce accurate and consistent results. These tests may be unreliable because of newly-written ...
Read more >
How to handle flaky tests | Serverless First
Flaky tests are automated tests that are non-deterministic. That means they may pass or fail when executed against the same build artifact ...
Read more >
Flaky Tests - A War that Never Ends | HackerNoon
A way to deal this kind of flakiness is to rerun all your tests in the same order when it failed. A test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found