-
Notifications
You must be signed in to change notification settings - Fork 13
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
Flaky Tests Hub #844
Comments
That first one is fine @doc-han - the await at the end is just to close the test out nicely. It's not really significant |
We can skip that sigterm one, it's fine:) |
@doc-han I'm really not sure what's up with the docgen one. It'll occasionally fail locally too, but I can't reliably repro and have yet to see the exact problem. I've spent too much time on this and I've skipped it for now. There's clearly a timing issue go on but I can't work out where. Yes, the promise starts executing immediately. The docgen function will SYNCHRONOUSLY create a placeholder file, then asynchronously start running doc gen, and synchronously return that promise. It's like the synchronous file write hasn't actually commited to disk by the time we read the file back. Which is weird because fundamentally I expect Maybe |
Yeah, I think skipping is the best option now. The only solution is to change how |
I think mock-fs on node 22 is the real problem. I think the mock is slow, or something, and it's possible to try and read the file before the write has finished in the background, and that's what's triggering these errors. I'm certainly noticing that tests which use mock-fs are running very slowly. I also can't seem to reproduce the uncaught error thing by throwing in strategic places. I really don't understand why the error isn't caught. |
Description
This is a space dedicated to tracking known flaky tests and systematically resolving them.
Note
Flaky Tests
Reason[1]: Promise functions start resolving as soon as they've been called.
await
doesn't tell a promise to start resolving but rather blocks execution only in the scope of its async function.Reason[2]: A placeholder is supposed to be generated quickly before the promise is resolved. Here, we're trying to test in between the time the placeholder is generator and when the promise with the actual data is resolved. Since there's no good mechanism to test in-between promise call and resolution, it makes this test very flaky. Hence, an error is thrown when the placeholder doesn't exist but we try doing
JSON.parse(readFileSync(path, 'utf8'));
kit/packages/cli/test/docgen/handler.test.ts
Lines 137 to 157 in 7554a34
Related Issue: no issue created
Reason:
workerProcess.kill('SIGTERM')
doesn't kill a process exactly after it has been called. It's async and may take some time to actually kill the process. Hence at times, the job gets processed before, other times not depending on computer resource available.kit/integration-tests/worker/test/server.test.ts
Lines 98 to 145 in 535da76
SKIPPED
The text was updated successfully, but these errors were encountered: