Repository navigation
Conversation
skourta
force-pushed
the
dpe-10091-log-collection-phase-3
branch
from
November 6, 2026 11:32
8465d3a to
28b3b8f
Compare
skourta
requested review from
akram09 and
reneradoi
and removed request for
reneradoi
November 6, 2026 11:32
skourta
marked this pull request as ready for review
November 6, 2026 11:36
reneradoi
reviewed
Nov 6, 2026
reneradoi
left a comment
Contributor
There was a problem hiding this comment.
Minor comment on including the new watchers for the overhead metrics.
reneradoi
approved these changes
Nov 9, 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.
A failed charm run often comes from the host: an OOM kill, an AppArmor denial, an I/O error, or a snap refresh mid-run. The collect bundle had none of those events, and nothing tied a log line to the test that was running. This adds the last of the DA282 Phase 3 files.
Solution
host-watch.shfollowsdmesg -Wintokernel.logandjournalctl -u snapdintosnapd.log. It runs as root, is skipped without passwordlesssudoor withlogs: false, andstop-watcher.shstops it. Both start atstart, and the kernel log is unfiltered.env-snapshot.shwritesenv-start.jsonandenv-end.jsonfrom snapd's REST API: kernel version, snaps and recent changes. It needs no root and givesnullfields without snapd.stopinputtest-logcopies the job's tee'd output topytest.log.startinputmarkers, defaultfalse, loadspytest/flake0_markers.pythroughPYTEST_PLUGINSandPYTHONPATHin$GITHUB_ENV. The plugin writes a start and a finish line per test tomarkers.ndjson. It is opt-in because a later step that replacesPYTHONPATHwould make pytest fail at startup.stop.shnow redacts every*.logandmarkers.ndjson, and removes the__pycache__that root's pytest leaves in the action directory.redact.shapplies listed values before the patterns, longest first, from a program file. Before, a pattern or a shorter value could split a listed secret, and+ ? ( ) { } |in a value could mask the wrong text or stop all masking. A value list over 128 KB stopped sed from running.redact.sednow masks quoted JSON and Python dict values, JSON nested in a string,secret-keyand URL credentials. A one-line PEM no longer deletes the rest of the file, andTestPassword::test_xandtest_basic FAILEDstay readable.Testing
pytest tests/: 94 passed. New files aretest_markers.py,test_env_snapshot.pyandtest_start_stop.py, with more cases intest_redact.py.shellcheck0.9.0 andruffclean.sudo: a token written to/dev/kmsgreachedkernel.log, and no follower survivedstop-watcher.sh.PYTHONPATHthroughpass_envalone makes pytest fail.pytest-rerunfailures16.7 gives a pair per attempt.pytest-retry1.7.0 gives one pair withfailed.smoke-collectnow covers the new files, and all 6consumer-simjobs passed.consumer-simruns pytest as root inside spread and checks that the probe test's markers reachmarkers.ndjson, so the$(HOST: ...)forwarding works. It only checks thatkernel.logexists, sodmesg -Wis shown to start on the 24.04 and 26.04 runners, not to capture lines.markers: true, the six consumer lines andredact-valuesfed from the job's secrets. In run 42178729841, 172 checks passed and 15 failed, none from flake0. Snap store downloads stalled at 0 bytes/s in 10 jobs (charmcraft, jhack, lxd, juju-db), and the rest were load timeouts, the 180-minute step limit, asecret-getpermission error and the PR title check.snapd.logand both env snapshots.kernel.loghad lines in 156, andpytest.log(156) andmarkers.ndjson(153) were missing only where no test ran: 6 jobs timed out installing charmcraft and 3 failed in spread prepare.snapd.lognamed the stalled jhack download, andenv-end.jsonshowed charmcraft stuck at 16.7 of 81.9 MB. A pattern scan of every bundle found no unredacted secret, and the AWS, Azure and GCPexportlines read***REDACTED***.Notes
markers: trueand adds six lines.spread.yamlforwardsFLAKE0_MARKERS,PYTEST_PLUGINSandPYTHONPATHin thegithub-cibackend.tox.iniaddsFLAKE0_MARKERSandPYTEST_PLUGINStopass_env, and appends:{env:PYTHONPATH:}to the existingset_envline, becauseset_envoverridespass_env. These go in together, or pytest fails at startup.env-*.jsonare not redacted, andlogs: falsedoes not turn them off. snapd'serrandlogfields can hold snap hook output. The README warns about this.$GITHUB_ENVbeats a job-levelenv:PYTHONPATH, and a step-levelenv:beats$GITHUB_ENV(checked in a scratch workflow). Only a step that sets its ownPYTHONPATHmust keep the existing value, as the README says.