Commit 3d2b4d6
test(node): Fix flaky thread-blocked-native worker thread test (#21026)
closes #20703
closes
[JS-2371](https://linear.app/getsentry/issue/JS-2371/flaky-ci-node-24-ts-38-integration-tests-suitesthread-blocked)
closes #20676
closes
[JS-2358](https://linear.app/getsentry/issue/JS-2358/flaky-ci-node-20-integration-tests-suitesthread-blocked-nativetestts)
This was the best guess from Claude. I tried to reproduce this locally
but failed. I used Docker to change the resources and lowered the CPU
and memory on a reproduction. But I never reproduced the same failing
state. However, this new approach is faster (Claude was very proud of
that) as it is not waiting 10s, before it starts, but starts as soon as
everything is set up - that also never failed locally - so it is a shot
in the dark 🤞
---
Claude message:
The worker thread test was flaky on CI because it used a fixed 10s delay
before blocking the event loop. On slow CI machines, the Sentry SDK
polling might not have fully started within that time window.
Replace the fixed delay with active polling that waits for the
ThreadBlocked integration to be installed, then waits 1s for polling to
start before blocking.
This makes the test:
- More reliable: actively verifies Sentry is ready instead of hoping
- Faster: ~3s vs ~12s locally
- Has a 30s timeout as a safety net
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 9bd04f0 commit 3d2b4d6
1 file changed
Lines changed: 23 additions & 2 deletions
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
4 | 25 | | |
5 | | - | |
| 26 | + | |
0 commit comments