Skip to content

[ci] deflake journald mock test + warn when shellcheck missing locally#68

Merged
trilamsr merged 1 commit into
mainfrom
worktree-deflake-and-shellcheck-hint
May 19, 2026
Merged

[ci] deflake journald mock test + warn when shellcheck missing locally#68
trilamsr merged 1 commit into
mainfrom
worktree-deflake-and-shellcheck-hint

Conversation

@trilamsr

Copy link
Copy Markdown
Contributor

What this PR does

Two small fixes that turn this session's lessons into code instead of
notes-to-self:

1. Deflake TestJournaldSource_StreamsMockOutput

The 2s deadline for the mock-journalctl test was tight on loaded
macOS / CI runners — subprocess spawn + fixture read + goroutine
schedule could miss it. The test flaked on 5 of 5 PRs in this
session that exercised the full suite (#55, #60, #62, #63, #64).

Bumped the deadline 2s → 5s. The non-flake budget for "no record
ever emitted" regressions stays well under the deadline; 5s just
absorbs runner jitter without hiding real bugs.

2. Warn locally when shellcheck isn't on PATH

actionlint silently skips run-block shellcheck when shellcheck
isn't on PATH (macOS doesn't ship shellcheck by default). PR #62
passed make actionlint locally and then surfaced 4 shellcheck
findings in CI — exactly the failure mode the gate is supposed to
prevent.

make actionlint now prints a WARNING: shellcheck not on PATH; actionlint will skip run-block shellcheck. line with brew install / apt-get install hints when the binary is missing.
The underlying lint still runs; the warning just makes the gap
visible to the macOS dev.

Linked issue(s)

No linked issue.

Release notes

NONE

Checklist

  • make ci exit 0 (test passes deterministically with new deadline)
  • make actionlint shows the warning when shellcheck is uninstalled (verified locally)
  • No behavior change in CI (shellcheck already on Linux runners)
  • Commits are signed off

🤖 Generated with Claude Code

Two small fixes for the lessons that surfaced during this session's
linter-gate work:

1. components/receivers/kernelevents/journald_test.go:
   TestJournaldSource_StreamsMockOutput's 2s deadline was tight on
   loaded macOS / CI runners — subprocess spawn + fixture read +
   goroutine schedule could miss it. Flaked on 5 of 5 PRs that
   exercised the full suite (#55, #60, #62, #63, #64). Bumped to 5s.
   The non-flake budget for "no record ever emitted" regressions
   stays well under the deadline; 5s just absorbs runner jitter.

2. Makefile actionlint target:
   actionlint silently skips run-block shellcheck when shellcheck
   isn't on PATH (macOS doesn't ship it by default). PR #62 passed
   `make actionlint` locally and then failed CI on 4 shellcheck
   findings. Added a presence check that prints brew/apt install
   hints; the underlying lint still runs.

Verification: `make ci` exit 0 (no flake this run).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Tri Lam <trilamsr@gmail.com>
@trilamsr trilamsr enabled auto-merge (squash) May 19, 2026 04:39
@trilamsr trilamsr merged commit 06a6f1f into main May 19, 2026
13 checks passed
@trilamsr trilamsr deleted the worktree-deflake-and-shellcheck-hint branch May 19, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant