Skip to content

Flaky CI: logs -f follow tests and kubo restart-race test fail under CI runner load #77

@Rinse12

Description

@Rinse12

Summary

Two timing-sensitive integration tests fail intermittently on loaded CI runners (observed on master CI run 27133947713). Both pass reliably locally.

Failures observed

  1. macostest/cli/logs.test.ts:462 › "continues watching old file if no new file appears": stdout contained the initial line but not APPENDED_LINE.
  2. ubuntutest/cli/daemon-kubo-restart-race.test.ts:262 › "kubo is killed on SIGTERM even when a signal-exit handler registered after the exit hook": expect(kuboRestarted).toBe(true) (setup precondition) timed out. Ran 43.8s on CI; passes in ~13s locally.

Root cause

  • logs -f tests: the 8s SIGINT kill timer is anchored to process spawn. The budget must cover CLI cold-start (oclif/pkc-js import, which can be several seconds) + printing the initial marker + detecting the file change + flushing the second marker. On a slow runner, startup eats the budget and the process is killed before the awaited line is emitted. All three tests in the bitsocial logs -f (file rotation) block share this pattern.
  • restart-race test: the restarted-kubo detect window (waitForCondition, 30s) is too tight given the test injects PKC_CLI_TEST_IPFS_READY_DELAY_MS=5000 and the runner may be heavily loaded with parallel kubo nodes. The overall test timeout is 120s, so there is headroom to widen.

Fix

  • logs -f tests: kill as soon as the awaited output is observed, with a generous safety-cap timeout instead of a fixed 8s wall.
  • restart-race test: widen the restarted-kubo detect window to account for the injected ready delay + runner load.

These are test-harness robustness fixes; no production code change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions