Commit ebcb987
authored
fix(test): unreliable "AuthUtil CodeWhisperer uses fallback connection" #5788
## Problem:
This test was flaky due to the event emitter and the test expecting 2 of
the same event to come in, but sometimes the second one was not capture.
This looks to be due to the second `captureEventOnce` call needing to do
some initial setup before it could capture an event. And I think there
was a race condition between it being setup in time and the event being
emitted before it could start listening.
## Solution:
Make a new function which does the event capture once and then listens N
amount of times. This is reliable.1 parent 11b1ce6 commit ebcb987
File tree
2 files changed
+15
-8
lines changed- packages
- amazonq/test/unit/codewhisperer/util
- core/src/test
2 files changed
+15
-8
lines changedLines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
| 237 | + | |
237 | 238 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | 239 | | |
242 | | - | |
| 240 | + | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
568 | 572 | | |
569 | 573 | | |
570 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
571 | 580 | | |
572 | 581 | | |
573 | 582 | | |
| |||
0 commit comments