Commit 795a21d
test: fix flaky test-inspector-connect-main-thread
Previously, the test waited for a (any) message from the workers, and then attached another event listener to a specific kind of message. However, it was possible that the second listener was attached after the Worker had already exited, thus never receiving the message it was supposed to receive. (This is the race condition here – usually, the Worker thread would exit *after* the second listener was attached.) Solve this by keeping a single `'message'` event listener attached to the worker instance during its entire lifetime. Fixes: #31226 PR-URL: #31637 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Rich Trott <[email protected]>1 parent c34672a commit 795a21d
1 file changed
+15
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 64 | + | |
| 65 | + | |
75 | 66 | | |
76 | 67 | | |
77 | 68 | | |
| |||
107 | 98 | | |
108 | 99 | | |
109 | 100 | | |
110 | | - | |
111 | | - | |
| 101 | + | |
112 | 102 | | |
113 | | - | |
| 103 | + | |
114 | 104 | | |
115 | 105 | | |
116 | 106 | | |
| |||
122 | 112 | | |
123 | 113 | | |
124 | 114 | | |
125 | | - | |
| 115 | + | |
126 | 116 | | |
127 | 117 | | |
128 | 118 | | |
| |||
0 commit comments