Repository navigation
Commit 3dfa2bf
authored
fix: Eliminate race condition in testInputRequiredWorkflow (#630)
The test consumers were counting down their latches on the FIRST
TaskEvent received, which could be the intermediate WORKING state
instead of the expected terminal state (INPUT_REQUIRED or COMPLETED).
This caused intermittent test failures with:
expected: <INPUT_REQUIRED> but was: <WORKING>
Fix: Both consumers now only count down when receiving the expected
terminal state:
- initialConsumer waits for INPUT_REQUIRED (not WORKING)
- completionConsumer waits for COMPLETED (not WORKING)
This matches the agent's event emission pattern:
agentEmitter.startWork() // WORKING state
agentEmitter.requiresInput(...) // INPUT_REQUIRED state
...later...
agentEmitter.startWork() // WORKING state
agentEmitter.complete() // COMPLETED state1 parent 29bd6bb commit 3dfa2bf
1 file changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1512 | 1512 | | |
1513 | 1513 | | |
1514 | 1514 | | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
1515 | 1519 | | |
1516 | | - | |
1517 | | - | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1518 | 1526 | | |
1519 | 1527 | | |
1520 | 1528 | | |
| |||
1538 | 1546 | | |
1539 | 1547 | | |
1540 | 1548 | | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1541 | 1553 | | |
1542 | | - | |
1543 | | - | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
1544 | 1560 | | |
1545 | 1561 | | |
1546 | 1562 | | |
| |||
0 commit comments