Skip to content

Tier 2: triage 7 remaining failures (post-#56 harness fix) #61

Closed

Description

@scttfrdmn

Context

With the #56 harness fix, the full Tier 2 suite now runs cleanly (17/24 pass, 316s, no timeouts) against real AWS. 7 failures remain — these are real product/test issues, NOT the harness timeout. Triaging them here so each can be addressed; some are likely test-design issues, some may be real bugs.

The 7 failures

  1. TestTier2_FSxTagsWritten — launch ... --fsx-id fs-00000000000000000 → FileSystemNotFound. Test bug: uses a hardcoded fake FSx id that doesn't exist. The test needs to create (or skip if absent) a real FSx filesystem, or assert the tag-writing logic without a live FSx. Pre-existing, unrelated to e2e Tier 2 harness can't run ~22 launches in parallel — waitForRunning times out, SSH ControlMaster contention #56.

  2. TestTier2_HibernateAndResume + 3. TestTier2_ConnectWakesHibernated — spawn hibernate ... exit status 1, failing right after "Requesting hibernate" at uptime 1m0s. Likely test timing: hibernating ~1 min after launch is too early — the instance/hibernation agent isn't ready yet (EC2 rejects hibernate until initialized). Either wait for readiness before hibernating, or this surfaces a real "hibernate too soon" gap. Needs the actual AWS error captured (currently truncated). (Note: ConnectWakesHibernated is the new test from PR test(e2e): strengthen connect wake/reconnect coverage (stopped + hibernated) #59.)

  3. TestTier2_IAMPolicyApplied — --iam-policy s3:ReadOnly did not grant S3 access. Likely IAM propagation timing (instance-profile/policy not effective yet when the test checks), or a real policy-application bug. Needs a retry/wait or root-cause.

  4. TestTier2_PreStop — /tmp/prestop-ran.txt not found. The pre-stop hook didn't run (or didn't finish) before the assertion. Timing vs. spored, or real.

  5. TestTier2_CommandExecution — connect -- cat /tmp/cmd-ran.txt exit 1. The --command (run at launch) hadn't created the file when connect checked. Likely spored/command timing.

  6. TestTier2_NameResolutionPrefersRunning ([audit] Flags: launch uses --key-pair vs --key-name on autoscale/burst #313) — connect picked an instance but the test's assertion about which (running vs stopped dup) didn't match cleanly. Possible flake or a [audit] Flags: launch uses --key-pair vs --key-name on autoscale/burst #313 regression; needs the actual vs expected instance id compared.

Likely categories

Asks

Address each (most are likely "wait for readiness before asserting" in the test, but #4/#7 should be confirmed not-a-product-bug). Capture the truncated AWS errors for the hibernate failures. Once fixed, Tier 2 should be 24/24.

Context

Found in the first clean full Tier 2 run after #56. Cost control intact (0 instances leaked).

Activity

  1. added
    bug
    on Jun 5, 2026
  2. scttfrdmn commented on Jun 5, 2026

    @scttfrdmn
    ContributorAuthor

    Worked through all 7 against real AWS. Result: 3 resolved, 4 are real product gaps (not test timing). Test improvements landed in a PR; the 4 product issues are detailed below for follow-up.

    Resolved ✅

    • HibernateAndResume + ConnectWakesHibernated — confirmed it was timing: spawn hibernate ~1 min post-boot returns exit 1 because the EC2 hibernation agent isn't initialized yet. Added hibernateEventually (retry until accepted). Both now PASS (~186s / 190s).
    • FSxTagsWritten — --fsx-id is validated against the real FSx API at launch (GetFSxFilesystem → DescribeFileSystems), so a fake id can never work through the launch path. The test was structurally broken. Now skips unless E2E_FSX_ID is set; the [audit] Flags: async flag is --detach (launch/sweep) vs --detached (pipeline launch); pipeline flag is also a no-op #314 tag-writing regression is already covered without AWS by pkg/aws/tags_test.go. So no e2e coverage lost.

    Real product gaps (test now polls correctly, but the behavior is missing) ⚠️

    1. --command appears to no-op on a SINGLE (non-sweep) launch. cmd/launch.go:1787 maps --command → config.JobArrayCommand, but the only code that executes it (cmd/launch.go:~2249) lives inside the parameter-sweep user-data block, keyed on reading the spawn:command tag. A plain spawn launch --command '...' doesn't go through that path, so the command never runs. TestTier2_CommandExecution polls 4 min for the marker file and never sees it. Needs a product fix: execute --command for single launches (via spored or the bootstrap), not only for sweeps. (This may also be why launch should fail if spored fails to install on the instance #50/nf-spawn-style single-instance command runs are unreliable.)

    2. --pre-stop marker never appears (TestTier2_PreStop) — likely the same/related single-instance execution gap (pre-stop hook not wired for non-sweep launches, or not firing on completion).

    3. --iam-policy s3:ReadOnly doesn't grant S3 within 4 min (TestTier2_IAMPolicyApplied). Could still be propagation, but 4 min is generous — worth confirming the policy is actually attached to the instance profile for single launches.

    4. NameResolutionPrefersRunning ([audit] Flags: launch uses --key-pair vs --key-name on autoscale/burst #313) — connect-by-name to the running dup; needs the actual-vs-expected instance id captured to confirm it's a real [audit] Flags: launch uses --key-pair vs --key-name on autoscale/burst #313 regression vs a connect-readiness race.

    Status

  3. scttfrdmn commented on Jun 6, 2026

    @scttfrdmn
    ContributorAuthor

    Status update — 4/7 resolved, root causes found for the rest

    Fixed (PR pending merge)

    • CommandExecution ✅ — was TWO real bugs: (a) --command exec was nested inside the sweep-only SWEEP_ID gate, so single launches never ran it; (b) it used su - local, but no local user exists (bootstrap creates $LOCAL_USERNAME). Both fixed — command now runs for any instance, as the correct user. PASSES.
    • HibernateAndResume, ConnectWakesHibernated ✅ — timing; hibernateEventually retries until the EC2 hibernation agent is ready. PASS.
    • FSxTagsWritten ✅ — structurally broken (fake fs-id fails real FSx validation at launch); skips unless E2E_FSX_ID set; [audit] Flags: async flag is --detach (launch/sweep) vs --detached (pipeline launch); pipeline flag is also a no-op #314 covered by pkg/aws/tags_test.go.

    Root-caused, separate issues filed

    • All 3 of pre-stop/iam/name-resolution failed at launch under parallelism on the shared spored-instance-role IAM race → filed Concurrent launches race on shared spored-instance-role IAM setup → launch fails #64. Harness now serializes launches (launchSem=1) to avoid it in tests.
    • Run serialized, PreStop still fails — but it's a test race, not a product bug: spored detects completion (~1m tick) → 5s delay → runs pre-stop (touch) → ~5s later terminates. The test SSHes to check the marker after pre-stop, but the instance is already terminating, so connect can't reach it. Fix: use --on-complete stop (instance survives) and assert the marker after it stops, or have spored record pre-stop completion in a tag/log the test can read post-mortem. pre-stop itself works.
    • Separately filed --pre-stop runs as root, should run as the instance user #63: pre-stop runs as root, should run as the instance user (like --command now does).

    Still to confirm

    Net

    Tier 2: 20/24 green + CommandExecution = effectively 21, with the remaining 3 understood (pre-stop test-race; iam/name-res blocked on the #64 launch race). No harness/timeout issues remain.

  4. scttfrdmn commented on Oct 19, 2026

    @scttfrdmn
    ContributorAuthor

    All 7 failures resolved or split out: hibernate x2 and FSx fixed in a5fc6b4 (#62); CommandExecution fixed in 7f55e7d (#69); the launch race behind PreStop/IAM/name-resolution filed as #64 (closed, completed) and pre-stop-as-root as #63 (closed, completed). On main, TestTier2_PreStop uses --on-complete stop with a /var/tmp marker and TestTier2_IAMPolicyApplied polls for propagation (test/e2e/tier2_test.go).

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