Closed yannbf closed 1 month ago
To address the CI flake in BootstrapQueue.test.ts
, consider the following steps:
Ensure consistent test environment: Verify that the test environment is correctly set up and torn down in beforeEach
and afterEach
hooks.
Increase wait intervals: Modify the instantWaitFor
function to use a slightly longer interval to account for potential timing issues:
const instantWaitFor = (fn: () => void) => {
return vi.waitFor(fn, {
interval: 10,
});
};
Add more robust error handling: Ensure that any asynchronous operations are properly caught and handled to prevent unhandled promise rejections.
Check for race conditions: Review the test cases to ensure there are no race conditions, especially in the queueBootstrapping
function calls.
Stabilize async operations: Ensure that all Subject
instances are properly completed or errored to avoid hanging promises.
These steps should help in reducing the flakiness of the tests.
/code/frameworks/angular/src/client/angular-beta/utils/BootstrapQueue.test.ts
Not flaky anymore
Code: https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/src/client/angular-beta/utils/BootstrapQueue.test.ts
Flake: https://app.circleci.com/pipelines/github/storybookjs/storybook/79402/workflows/dc88f162-574a-432d-a936-848fb9fe8c07/jobs/676408