Repository navigation
Keep the timeline events in the observability golden fixture - #947
Merged
chrisgleissner merged 4 commits intoOct 2, 2026
Merged
chrisgleissner merged 4 commits into
chrisgleissner merged 4 commits into
Conversation
Full order failed on the CI runner: the processes' records interleave by scheduling.
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
The observability golden fixture
tests/lib/fixtures/e2e-run.expected.mdstores the Timeline section of the gate report as a single line count. Any change to runner output edits that number, so two branches that both change runner output conflict on it, or merge cleanly with a wrong count. The fixture now stores the timeline's events as sorted lines. The clock is replaced by a fixed value, and device-request lines are left out, because their wording depends on scheduling.This removes the conflict on the PR #705 sync that motivated the change. In a simulation of parallel branches, the fixture merges cleanly and correctly in 92% of cases, against 0% for the count. The canonical timeline does not change when every process's timestamps are skewed by up to 5 s, so it cannot vary between machines. The golden test also catches changes to event wording that the count missed.
Previous behaviour
canonicalize_document()intests/lib/observability/support.pyreplaced the whole Timeline section withN line(s), order not compared here.Problem
Every change that adds or removes a runner event changes N. Two branches that each add events both edit that line. They conflict, or, when both add the same number of lines, they merge cleanly with a count that matches neither. The last sync of #705 with master hit the conflict: master's IEC-bus teardown changed the count from 212 to 225, and #705's cartridge-preference message changed it from 212 to 215.
The count also passed any change to event wording that kept the number of lines.
Change
_timeline_events()canonicalises the Timeline section:00:00:00 +00:00, and the lines are sorted.describe_actionwrites it (<source> GET|PUT|POST|... /path), or a run of requests collapsed intoN device requests (...). These lines are left out.-offset thattools/e2e_report.pywrites when it has no start time.collects on …, so none of it will arrive; set '…' to '…:PORT'sentence, so the device's real port in thecollects atmessage is left alone.The sort and the dropped request lines are needed for stability. The timeline merges records from the runner, each suite process and syslog, and each source carries its own clock.
timeline_section()sorts them by time, so their interleaving follows how the machine scheduled the processes. Request lines also change their wording with that order. A run of requests is collapsed into a count, or listed in full when it is near a failure, depending on the events beside it.The first revision of this PR kept the full order. It passed on every local build and failed on the CI runner (run 36932619462). Every other event line is written regardless of order, so these lines, sorted, are what every build reproduces. Order and requests are still checked against a live document by
the_timeline_is_the_whole_run_in_order, which checks wall-clock order, the presence ofGET /v1/machine:menu_screen, and the repeat limit.Verification
make observability_testinmy_docker_image(Python 3.10, the CI command) passed 3 of 3 times. The golden tier passed in 8 of 8 containers limited to a quarter of a CPU each. Locally,observability_test.pyreports 180 cases OK and 2 skipped, andlint_testis OK.2c60bd8fc), on the Machine code monitor debugger #705 head (893877ce1), on master (1e17efcba) and on the actual merge commit (31d27b3f1).git merge-fileis byte-identical to the recording made on the merge commit.tools/e2e_report.py:2004I changed the suite event<key> startedto<key> begun.support.pyand fixture, tier 4 passes.the document is byte identical to the expected onefails.the_canonical_timeline_is_its_events_sortedchecks that the clock and request lines are removed and the rest sorted. It checks that the same events in reverse order give the same result, and that a second pass changes nothing. Its inputs include a-offset and an event whose text begins with a clock. It also checks that only the collector's port is replaced.Remaining limitations