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

Intermittent CI test failures #275

Closed
HerbCaudill opened this issue Jan 22, 2024 · 0 comments · Fixed by #277
Closed

Intermittent CI test failures #275

HerbCaudill opened this issue Jan 22, 2024 · 0 comments · Fixed by #277
Assignees

Comments

@HerbCaudill
Copy link
Collaborator

HerbCaudill commented Jan 22, 2024

The test action failed twice on #274, and passed the third time I ran it:

Attempt #1
Attempt #2
Attempt #3

In all cases the tests are all passing, but Vitest fails the test run if any errors are thrown after the test environment is torn down.

⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
Unknown Error: bad theirHave: error loading have at index 0: bad bloom: the value was not a Uint8Array
This error originated in "packages/automerge-repo/test/remoteHeads.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
This error was caught after test environment was torn down. Make sure to cancel any running tasks before test finishes:
- cancel timeouts using clearTimeout and clearInterval
- wait for promises to resolve using the await keyword
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 Test Files  15 passed (15)
      Tests  164 passed (164)
     Errors  1 error

I haven't been able to reproduce the failure locally, so it may have something to do with the CI runner being a bit slower than my laptop. This bit in the setup function looks suspicious to me:

// connect them all up
connectRepos(leftTab1, leftServiceWorker)
connectRepos(leftTab2, leftServiceWorker)
connectRepos(leftServiceWorker, syncServer)
connectRepos(syncServer, rightServiceWorker)
connectRepos(rightServiceWorker, rightTab)
await setTimeout(100)

There are similarly arbitrary pauses in the tests themselves:

// subscribe to the left service worker storage ID on the right tab
rightTab.subscribeToRemotes([await leftServiceWorker.storageId()!])
await setTimeout(100)

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 a pull request may close this issue.

1 participant