Skip to content

slow lane: a failing run deletes its daemon logs, so the reason a device failed is lost #1158

Closed

Description

@V3RON

A shared daemon's teardown removes its whole home, daemon.log included (e2e/helpers/env.ts:502, rm(home, ...); the log path is set at env.ts:249). The slow-lane log only has the test output. So when a slow-lane test fails because a device would not come up, nothing records why.

Example: in two runs from #1102 (/var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/simlock-slow-e2e-20261030-222307.log and -225042.log), warmUp waited 330 s with one Android device stuck in shutdown (last observed: shutdown,ready). The driver's reason (device-provisioner.ts:126 logs it, then raises a plain BootTimeoutError) was only in the deleted daemon.log.

Expected: a run whose test failed keeps each daemon's log, or copies it next to the lane log, before it removes the home.

Found while triaging #1102.

Written by an agent.

Activity

  1. added
    bug:new
    on Oct 31, 2026
  2. self-assigned this
    on Oct 31, 2026
  3. V3RON commented on Oct 31, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    Gap: nothing promises the logs survive. The expectation (a copy in SIMLOCK_E2E_LOG_DIR) is a proposal.

    e2e/helpers/env.test.ts on bug/1158-repro, "after a run whose flows fail, leaves the log of each daemon it started in SIMLOCK_E2E_LOG_DIR". It starts its own vitest run with fake-driver flows that fail like #1102 did: a withSharedDaemon suite that throws in beforeAll (as warmUp does) and a withDaemon test that fails.

    pnpm test:e2e e2e/helpers/env.test.ts
    
    AssertionError: expected [ …(2) ] to deeply equal []
    +   ".../T/simlock-e2e-O1o8FL/daemon.sock",
    +   ".../T/simlock-e2e-nPHoDm/daemon.sock",
     ❯ e2e/helpers/env.test.ts:94:20   expect(lost).toEqual([])
    

    It passes once a 5-line copy is added to teardown().

    Root cause

    e2e/helpers/env.ts:502: teardown() deletes the home (rm(home, …)), and the log is inside it (env.ts:249). Both withDaemon (env.ts:57) and withSharedDaemon (env.ts:444) do this whether the run passed or failed. The lane has nowhere to keep a log: scripts/slow-e2e.sh writes only vitest's output, and the next run's clean deletes /tmp/simlock-slow (slow-e2e.sh:97). I read simlock-slow-e2e-20261030-222307.log: it ends at last observed: shutdown,ready and has no daemon lines. The driver's reason is logged only in daemon.log (src/core/device-provisioner.ts:125).

    Simplest fix

    In teardown(), when SIMLOCK_E2E_LOG_DIR is set, copy <dataDirectory>/daemon.log* to $SIMLOCK_E2E_LOG_DIR/<basename(home)>/ before the rm. slow-e2e.sh sets the variable to ${log%.log}-daemons, and toolchain.md names that path. The shape this pins is the variable name and copying every time it is set.

    Alternatives rejected

    Risk

    • A failed copy must not hide teardown's own error.
    • Copy daemon.log.1; the gateway's directory is <home>/gateway.
    • Copies pile up in $TMPDIR, as lane logs already do.

    Written by an agent.

  4. removed their assignment
    on Oct 31, 2026
  5. added
    bug:ready
    and removed
    bug:new
    on Oct 31, 2026
  6. self-assigned this
    on Oct 31, 2026
  7. V3RON commented on Oct 31, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #1161 (#1158)
    Parked: none
    Waiting: none

    Written by an agent.

  8. added a commit that references this issue on Oct 31, 2026
    9af37e8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions