Commit f3f0a2c
authored
fix(enterprise/coderd/x/chatd): harden TestSubscribeRelayEstablishedMidStream against CI flakes (#24108)
Fixes coder/internal#1455
Three changes to eliminate the timing-sensitive flake in
`TestSubscribeRelayEstablishedMidStream`:
1. **Reduce `PendingChatAcquireInterval` from `time.Hour` to
`time.Second`.**
The primary trigger is still `signalWake()` from `SendMessage`, but a
short fallback poll ensures the worker picks up the pending chat
even under heavy CI goroutine scheduling contention.
2. **Increase context timeout from `WaitLong` (25s) to `WaitSuperLong`
(60s).**
The worker pipeline (model resolution, message loading, LLM call)
involves multiple DB round-trips that can be slow when PostgreSQL
is shared with many parallel test packages.
3. **Add a status-polling loop while waiting for the streaming
request.**
If the worker errors out during chat processing, the test now
fails immediately with the error status and message instead of
silently timing out.
> Generated by Coder Agents1 parent 5453a6c commit f3f0a2c
1 file changed
Lines changed: 36 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
1454 | | - | |
1455 | | - | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1456 | 1458 | | |
1457 | 1459 | | |
1458 | 1460 | | |
1459 | 1461 | | |
1460 | 1462 | | |
1461 | 1463 | | |
1462 | | - | |
| 1464 | + | |
1463 | 1465 | | |
1464 | 1466 | | |
1465 | 1467 | | |
| |||
1489 | 1491 | | |
1490 | 1492 | | |
1491 | 1493 | | |
1492 | | - | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
1493 | 1499 | | |
1494 | 1500 | | |
1495 | 1501 | | |
| |||
1509 | 1515 | | |
1510 | 1516 | | |
1511 | 1517 | | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
1517 | 1544 | | |
1518 | 1545 | | |
1519 | 1546 | | |
| |||
0 commit comments