Commit b0a7124
committed
fix: Eliminate race condition in testInputRequiredWorkflow
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 b0a7124
1 file changed
Lines changed: 12 additions & 4 deletions
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1513 | 1513 | | |
1514 | 1514 | | |
1515 | 1515 | | |
1516 | | - | |
1517 | | - | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
1518 | 1522 | | |
1519 | 1523 | | |
1520 | 1524 | | |
| |||
1539 | 1543 | | |
1540 | 1544 | | |
1541 | 1545 | | |
1542 | | - | |
1543 | | - | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
1544 | 1552 | | |
1545 | 1553 | | |
1546 | 1554 | | |
| |||
0 commit comments