Commit faabe08
authored
Fix TestFullDIFCConfigFromJSON timeout waiting for backend connections (#3960)
## Problem
`TestFullDIFCConfigFromJSON` fails with a 5s timeout waiting for
`"Starting MCPG"` in stderr:
```
Error: Should be true
Messages: timeout waiting for gateway stderr to contain "Starting MCPG" within 5s
```
## Root Cause
`"Starting MCPG in ROUTED/UNIFIED mode"` only prints **after**
`NewUnified()` returns. `NewUnified()` blocks on `registerAllTools()`
which tries to connect to all backends — including a Docker container
(`test/server1:latest`) with a **30s launch timeout**. The test's 5s
deadline expires while waiting for Docker to fail.
## Fix
The test's assertions only verify DIFC guard registration output, which
appears **before** the blocking backend connections. Changed the wait
string from `"Starting MCPG"` to `"[DIFC] Registered guard"`, added a
300ms flush delay, and removed the health check (which requires full
startup).
## Changes
| File | Change |
|------|--------|
| `test/integration/difc_config_test.go` | Wait for guard registration
instead of full startup; remove health check and unused `encoding/json`
import |
`make agent-finished` ✓1 file changed
Lines changed: 8 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
412 | 411 | | |
413 | 412 | | |
414 | 413 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
423 | 420 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
| 421 | + | |
| 422 | + | |
428 | 423 | | |
429 | 424 | | |
430 | 425 | | |
| |||
0 commit comments