feat(LinuxTentacleE2E): Phase 12.M.L.C.2 — register failure paths (401 + incomplete payload)
Summary
Two surgical failure-mode pins in one PR. Both reuse J.M.L.C.1's LinuxStubSquidServer + RegisterTestContext; only differ in stub configuration.
C1.u1 — 401 unauthorized → exit non-zero WITHOUT retry
Real-world driver: operator typos --api-key OR key revoked server-side.
Production contract: 4xx errors are NOT retried (TentacleRegistrationClient.RegisterAsync line 56-60).
Without this pin, regressions ship silently:
- 4xx retry regression → operator hangs ~5min on each typo'd API key (10 retries × exponential backoff)
- Exception swallowing → operator sees "success" but no config persisted
C1.u4 — incomplete payload → exit non-zero
Real-world driver: server-side regression / proxy injection returns malformed JSON (machineId=0 OR empty serverThumbprint).
Production contract: EnsureRegistrationPayloadComplete (line 174-177) rejects.
Without this pin, regressions ship silently:
- Operator sees "success" with bogus identity
- Server can't dispatch to the registered agent
- Subsequent dispatches reject with "machine not found"
Assertions (both tests)
| Assertion | Pins |
|---|---|
exitCode != 0 |
Failure path actually rejects |
| C1.u1: stub received exactly 1 call | 4xx no-retry contract |
| C1.u4: stub received call | Validation runs after payload received |
Config file NOT at /etc/squid-tentacle/instances/Default.config.json
|
Failure-path doesn't persist stale config |
Skipped from this PR
C1.u3 (5xx retry behavior): production retries 5xx with exponential backoff (1s → 60s × 10 attempts ≈ 5min). Testing requires overriding TentacleRegistrationClientOptions — needs a test-only escape hatch. Defer to dedicated PR with that infrastructure.
Fidelity tier
Expected runtime: ~2s combined.
Test plan
-
Linux E2E workflow runs (manual workflow_dispatchafter merge) -
C1u1_RegisterListening_Server401_ExitsNonZeroWithoutRetrypasses within ~3s -
C1u4_RegisterListening_IncompletePayload_ExitsNonZeropasses within ~3s -
No regression on existing 33 Linux E2E tests