| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dd53e6a commit c44db7f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,8 +21,6 @@ test-worker-memory: PASS,FLAKY | |||
| 21 | 21 | test-http2-client-upload: PASS,FLAKY | |
| 22 | 22 | # https://github.com/nodejs/node/issues/20750 | |
| 23 | 23 | test-http2-client-upload-reject: PASS,FLAKY | |
| 24 | - # https://github.com/nodejs/node/issues/28106 | ||
| 25 | - test-worker-debug: PASS,FLAKY | ||
| 26 | 24 | ||
| 27 | 25 | [$system==linux] | |
| 28 | 26 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -240,11 +240,17 @@ async function testWaitForDisconnectInWorker(session, post) { | |||
| 240 | 240 | }); | |
| 241 | 241 | await workerSession1.post('Runtime.runIfWaitingForDebugger'); | |
| 242 | 242 | ||
| 243 | + // Create the promises before sending the exit message to the Worker in order | ||
| 244 | + // to avoid race conditions. | ||
| 245 | + const disconnectPromise = | ||
| 246 | + waitForEvent(workerSession1, 'NodeRuntime.waitingForDisconnect'); | ||
| 247 | + const executionContextDestroyedPromise = | ||
| 248 | + waitForEvent(workerSession2, 'Runtime.executionContextDestroyed'); | ||
| 243 | 249 | worker.postMessage('resume'); | |
| 244 | 250 | ||
| 245 | - await waitForEvent(workerSession1, 'NodeRuntime.waitingForDisconnect'); | ||
| 251 | + await disconnectPromise; | ||
| 246 | 252 | post('NodeWorker.detach', { sessionId: sessionId1 }); | |
| 247 | - await waitForEvent(workerSession2, 'Runtime.executionContextDestroyed'); | ||
| 253 | + await executionContextDestroyedPromise; | ||
| 248 | 254 | ||
| 249 | 255 | await exitPromise; | |
| 250 | 256 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments