Skip to content

Fix CI failures by adding sleep backoff #870

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

Conversation

pokey
Copy link
Member

@pokey pokey commented Jul 15, 2022

Instead of sleeping the same amount of time every time we run a test, we double the sleep every time

Fixes #845

Checklist

teardown(() => {
sinon.restore();
});
standardSuiteSetup(this);
Copy link
Member Author

@pokey pokey Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice how for some tests we were retrying 3 times, other times 5. I put this standard preamble into a utility function to encourage consistency


// Check that setSelection is able to focus the correct cell
suite("Within cell set selection", async function () {
this.timeout("100s");
this.retries(3);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In particular, notice that the test that was failing in CI was only retrying 3 times, instead of the usual 5

@@ -24,7 +18,7 @@ async function runTest() {

// FIXME: There seems to be some timing issue when you create a notebook
// editor
await sleep(1000);
await sleepWithBackoff(1000);
Copy link
Member Author

@pokey pokey Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will now cause it to sleep 250ms, then 500ms, 1s, 2s, 4s. Hopefully that will both speed things up locally, while resolving the CI issues on Mac / Win

@pokey pokey requested a review from AndreasArvidsson July 15, 2022 14:37
@pokey
Copy link
Member Author

pokey commented Jul 15, 2022

Ok green 8 times in a row (the two "failures" in that streak are pre-commit complaining that there's a newer commit). Hopefully this one will last us a while 🤞

@pokey pokey merged commit a75fb00 into main Jul 15, 2022
@pokey pokey deleted the pokey/issue845-Within-cell-set-selection-fails-non-deterministically-on-ci branch July 15, 2022 15:37
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.

Within cell set selection fails non deterministically on ci
2 participants