test(stovepipe): add build-slow marker to the fake build runner - #464
Open
behinddwalls wants to merge 1 commit into
Open
test(stovepipe): add build-slow marker to the fake build runner#464behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
This was referenced Jul 29, 2026
behinddwalls
marked this pull request as ready for review
July 29, 2026 23:05
## 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. `SlowBuildDurationMs` is a package var so tests can tune it. 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
force-pushed
the
preetam/stovepipe-fake-slow-build
branch
from
July 30, 2026 07:51
cdcb128 to
48e5f92
Compare
mnoah1
reviewed
Jul 30, 2026
| // before succeeding. A var (not a const) so tests can shorten it; the local stack | ||
| // always uses the default. It must be long enough for the caller's poll loop to | ||
| // observe at least one non-terminal status. | ||
| var SlowBuildDurationMs int64 = 3000 |
Contributor
There was a problem hiding this comment.
An exported var just to be overridden by tests is a bit of an anti-pattern. We control the runner implementation below, so why not just set a default value New() and let tests set the struct field manually when needed.
mnoah1
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why?
The fake build runner never reports a non-terminal status —
Statusdecides purely from the build id and always returns succeeded, failed, or an error. That means no integration or e2e stack can reachbuildsignal'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-slowmarker.Triggerencodes a ready-at wall-clock instant into the build id (fake-build-slow-<readyAtMs>-<suffix>) andStatusreportsrunninguntil that instant passes, thensucceeded. Encoding the deadline in the id preserves the fake's stateless, decide-purely-from-the-id property, soTriggerandStatuscan still live in different processes.SlowBuildDurationMsis a package var so tests can tune it.Also widens
marker()to end a token at/as well as&and#. The fake SourceControl builds head URIs asgit://<queue>/HEAD, so a marker injected through a queue name sits mid-URI and would otherwise be read asbuild-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/...— coversbuild-slowreporting running then succeeded, the no-deadline fallback, andmarker()against trailing path segments, query separators, and end-of-URI.Stack