Skip to content

Address Copilot review on test-control-channel-skew.sh#79

Merged
lance0 merged 1 commit intomasterfrom
copilot-pr78-followups
May 3, 2026
Merged

Address Copilot review on test-control-channel-skew.sh#79
lance0 merged 1 commit intomasterfrom
copilot-pr78-followups

Conversation

@lance0
Copy link
Copy Markdown
Owner

@lance0 lance0 commented May 3, 2026

Five fixes from Copilot's review on PR #78 (which already merged — these are follow-ups). All valid findings.

Finding Fix
set -e + grep with no matches short-circuits before the explicit empty-check Wrap extraction in `
Filtering elapsed_secs == "0.001" is brittle (host-timing-dependent string) Numeric threshold >= 0.5
tc qdisc add fails with "File exists" on rerun if a prior qdisc is left over tc qdisc del first, with || true
Stale comment said "5-second test" but DURATION=8 Update comment
--json-stream timestamp format honors env/config; could break the awk parser Pass --timestamp-format relative explicitly

Re-validated in Docker: OLD binary (pre-NODELAY) → rc=1 with max bunch=3; NEW binary → rc=0 with max bunch=2. Assertion still differentiates correctly.

Test plan

  • Re-validate the script against pre-NODELAY and post-NODELAY binaries: differentiation preserved
  • Bash syntax check
  • CI run on this branch confirms the new test still passes on GitHub Actions Ubuntu kernel

Five small fixes from PR #78 review:

* set -euo pipefail + grep-with-no-matches would short-circuit the
  pipeline (grep exits 1 on empty result) and bypass the explicit
  empty-check below. Wrap the extraction in '|| true' so the explicit
  failure branch can fire with the intended diagnostic.

* Filtering the startup line by exact-string elapsed_secs == "0.001"
  is brittle — the value is computed from elapsed_ms / 1000.0 and
  renders as 0.0, 0.001, 0.002, etc. depending on host timing. Use a
  numeric threshold (>= 0.5) so the filter survives across
  environments. Real intervals start at 1.0+, so the threshold has
  comfortable headroom.

* tc qdisc add fails with 'File exists' if a root qdisc is already
  present on lo (rerunning after an interrupted run, or when a
  previous test left state behind). Issue 'tc qdisc del dev lo root'
  unconditionally before the add, with stderr suppression and || true
  so the no-existing-qdisc case isn't fatal.

* Stale comment said '5-second UDP test' but DURATION=8. Update to
  match actual behavior.

* --json-stream's 'timestamp' field follows --timestamp-format which
  can be overridden via XFR_TIMESTAMP_FORMAT env or config-file
  default, producing ISO 8601 / Unix epoch strings the awk parser
  doesn't handle. Pass --timestamp-format relative explicitly so the
  test is hermetic regardless of host config.

Re-validated in Docker: OLD binary (pre-NODELAY) consistently fails
with rc=1 (max bunch=3); NEW binary passes with rc=0 (max bunch=2).
No flake observed across runs.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Follow-up hardening for the repo-root CI regression script test-control-channel-skew.sh, addressing prior review findings to make the test more robust across reruns and environment/config differences.

Changes:

  • Make tc netem setup idempotent by deleting any pre-existing root qdisc on lo before adding the test shaper.
  • Pin --json-stream timestamps to a numeric relative format to keep the awk parser stable regardless of env/config defaults.
  • Make interval extraction resilient under set -euo pipefail and avoid brittle startup-line filtering by switching to a numeric elapsed threshold.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lance0 lance0 merged commit 719dbc9 into master May 3, 2026
12 checks passed
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