Skip to content

e2e Tier 2 harness can't run ~22 launches in parallel — waitForRunning times out, SSH ControlMaster contention #56

Closed

Description

@scttfrdmn

Summary

Running the full Tier 2 suite against real AWS (spore-host-dev) failed 15+ of 24 tests — but it's a test-harness scaling bug, not product bugs. The 3 that passed are the API-only tests that launch nothing (SlurmConvert, SpawnValidate, SpawnAvailability). Everything that launches an instance failed at the launch gate, so the suite validated almost nothing about actual product behavior (connect/wake/hibernate/on-complete).

Evidence

  • Every instance-launching test failed with: instance "e2e-..." did not reach running state within 10m0s (last state: ) — i.e. waitForRunning polled spawn list for 10 min and the instance never appeared (empty last state).
  • But the instances WERE running. A direct spawn list --region us-east-1 -o json mid-run returned all 24 instances with correct state: running and names. So spawn list works fine — the launches were just still queued/blocked past each test's 10-min deadline.
  • Heavy ControlSocket /Users/.../.ssh/cm-...@:22 already exists, disabling multiplexing noise in the logs: ~22 parallel spawn connect/DNS-registration calls collide on the shared SSH ControlMaster socket.

Root cause

The suite runs ~22 tests with t.Parallel(), each doing a real launch (slow: DNS-registration SSH, IAM, etc.) and polling spawn list every 15s. At 22-way concurrency the launches serialize/throttle — amplified by all the DNS-registration SSH sessions contending on one ~/.ssh/cm-* ControlMaster — so the per-test 10-min waitForRunning deadline fires before the instance is visible.

Proposed fixes (harness, not product)

  1. Cap launch concurrency — a small semaphore (e.g. 3–4 concurrent launches) in launchInstance, or drop t.Parallel() for the launch-heavy tests / run with -p 4. Real instances don't need 22-way parallelism.
  2. Disable DNS registration in e2e launches — add a --no-dns/equivalent (or set the test launches to skip it) so 22 concurrent SSH DNS-registration calls don't thrash the ControlMaster socket. (Also: should DNS registration use a per-instance ControlPath instead of a shared one? That's a possible product-side hardening.)
  3. Raise waitForRunning timeout only as a last resort — the real fix is reducing concurrency, not waiting longer.

Impact

Blocks getting a real pass/fail on Tier 2 product behavior (connect, auto-start/wake, hibernate/resume, on-complete, pre-stop, spored config). Until fixed, Tier 2 runs are not meaningful. Cost-control was fine — all instances reaped (TTL 15m + manual sweep); no leaks.

Context

Found running Tier 2 on real AWS. The cost-safety net (#47/#48) worked. This is purely the concurrency model of the test harness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions