Skip to content

test(stovepipe): add build-slow marker to the fake build runner - #464

Merged
behinddwalls merged 1 commit into
mainfrom
preetam/stovepipe-fake-slow-build
Jul 30, 2026
Merged

test(stovepipe): add build-slow marker to the fake build runner#464
behinddwalls merged 1 commit into
mainfrom
preetam/stovepipe-fake-slow-build

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

The fake build runner never reports a non-terminal status — Status decides purely from the build id and always returns succeeded, failed, or an error. That means no integration or e2e stack can reach buildsignal's reschedule branch, so the entire poll loop is exercised only by unit tests with mocked publishers. A defect in the reschedule path is invisible above the unit layer.

What?

Adds a build-slow marker. Trigger encodes a ready-at wall-clock instant into the build id (fake-build-slow-<readyAtMs>-<suffix>) and Status reports running until that instant passes, then succeeded. Encoding the deadline in the id preserves the fake's stateless, decide-purely-from-the-id property, so Trigger and Status can still live in different processes. The window is a slowBuildDuration field on the runner, defaulted in New(), so tests construct a runner with their own value instead of mutating shared state.

Also widens marker() to end a token at / as well as & and #. The fake SourceControl builds head URIs as git://<queue>/HEAD, so a marker injected through a queue name sits mid-URI and would otherwise be read as build-slow/HEAD. Existing markers sit at the end of a URI and are unaffected.

No pipeline behaviour changes; this only makes a previously unreachable path reachable in tests.

Test Plan

bazel test //stovepipe/... — covers build-slow reporting running then succeeded, the no-deadline fallback, and marker() against trailing path segments, query separators, and end-of-URI.

Stack

  1. @ test(stovepipe): add build-slow marker to the fake build runner #464
  2. fix(stovepipe): mint a distinct message id for each buildsignal re-poll #465
  3. refactor(stovepipe): replace recorded greenness states with build outcomes #466
  4. feat(stovepipe): record the build outcome on the request and free its slot #467
  5. feat(stovepipe)!: key the record stage on the request id #468
  6. fix(stovepipe): stop wrapping the buildsignal re-poll publish as retryable #469

Comment thread stovepipe/extension/buildrunner/fake/fake.go Outdated
## Summary

### Why?

The fake build runner never reports a non-terminal status — `Status` decides purely from the build id and always returns succeeded, failed, or an error. That means no integration or e2e stack can reach `buildsignal`'s reschedule branch, so the entire poll loop is exercised only by unit tests with mocked publishers. A defect in the reschedule path is invisible above the unit layer.

### What?

Adds a `build-slow` marker. `Trigger` encodes a ready-at wall-clock instant into the build id (`fake-build-slow-<readyAtMs>-<suffix>`) and `Status` reports `running` until that instant passes, then `succeeded`. Encoding the deadline in the id preserves the fake's stateless, decide-purely-from-the-id property, so `Trigger` and `Status` can still live in different processes. The window is a `slowBuildDuration` field on the runner, defaulted in `New()`, so tests construct a runner with their own value instead of mutating shared state.

Also widens `marker()` to end a token at `/` as well as `&` and `#`. The fake SourceControl builds head URIs as `git://<queue>/HEAD`, so a marker injected through a queue name sits mid-URI and would otherwise be read as `build-slow/HEAD`. Existing markers sit at the end of a URI and are unaffected.

No pipeline behaviour changes; this only makes a previously unreachable path reachable in tests.

## Test Plan

✅ `bazel test //stovepipe/...` — covers `build-slow` reporting running then succeeded, the no-deadline fallback, and `marker()` against trailing path segments, query separators, and end-of-URI.
@behinddwalls
behinddwalls force-pushed the preetam/stovepipe-fake-slow-build branch from 48e5f92 to 4c25f6d Compare July 30, 2026 18:20
@behinddwalls
behinddwalls added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit 772b4f8 Jul 30, 2026
15 checks passed
@behinddwalls
behinddwalls deleted the preetam/stovepipe-fake-slow-build branch July 30, 2026 18:31
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.

2 participants