-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Summary
The net_timestamping BPF selftest has subtests with colons in their names (INET4: bpf timestamping, etc.). When the traffic monitor is enabled in CI, these colons end up in pcap log filenames, which GitHub Actions' upload-artifact@v4 rejects. This causes every test_progs_parallel and test_progs_no_alu32_parallel job to fail at the artifact upload step, even when all tests pass.
Failure Details
- Test / Component: Traffic monitor pcap filename generation (
encode_test_name()innetwork_helpers.c) triggered bynet_timestampingsubtests - Frequency: Every run — affects all
test_progs_parallelandtest_progs_no_alu32_paralleljobs on x86_64 gcc-15 since thenet_timestampingtest was merged - Failure mode: Artifact upload timeout/rejection — the test itself passes, but CI job is marked as failed
- Affected architectures: x86_64 (parallel jobs only run on x86_64)
- CI runs observed:
- https://github.com/kernel-patches/bpf/actions/runs/22571439374 (test_progs_parallel, Mar 2)
- https://github.com/kernel-patches/bpf/actions/runs/22548287519 (test_progs_no_alu32_parallel, Mar 1)
- https://github.com/kernel-patches/bpf/actions/runs/22548322990 (test_progs_parallel, Mar 1)
- https://github.com/kernel-patches/bpf/actions/runs/22548372137 (test_progs_no_alu32_parallel, Mar 1)
- https://github.com/kernel-patches/bpf/actions/runs/22571297154 (test_progs_no_alu32_parallel, Mar 2)
- https://github.com/kernel-patches/bpf/actions/runs/22571185934 (test_progs_parallel, Mar 2)
Root Cause Analysis
The encode_test_name() function at tools/testing/selftests/bpf/network_helpers.c:1137 constructs filenames for traffic monitor pcap logs. It sanitizes / and (space) characters by replacing them with underscores, but does not sanitize colons (:).
The net_timestamping test (tools/testing/selftests/bpf/prog_tests/net_timestamping.c:231-238), introduced in commit f4924aec58dd ("selftests/bpf: Add simple bpf tests in the tx path for timestamping feature"), has four subtests with colons in their names:
test__start_subtest("INET4: bpf timestamping")
test__start_subtest("INET4: bpf and socket timestamping")
test__start_subtest("INET6: bpf timestamping")
test__start_subtest("INET6: bpf and socket timestamping")When traffic monitoring is enabled in CI (TEST_PROGS_TRAFFIC_MONITOR=true in the CI environment, which passes -m '*' to test_progs), traffic_monitor_start() calls encode_test_name() which produces filenames like:
packets-133-0-net_timestamping__INET4:_bpf_timestamping-net_timestamping_ns.log
The colon in INET4: passes through encode_test_name() unsanitized. GitHub Actions' upload-artifact@v4 rejects files with colons (and other special characters: ", <, >, |, *, ?), producing this error:
The path for one of the files in artifact is not valid:
/packets-133-0-net_timestamping__INET4:_bpf_timestamping-net_timestamping_ns.log.
Contains the following character: Colon :
The upload then times out, and the entire job is marked as failed.
Proposed Fix
Replace the two separate strchr() loops in encode_test_name() with a single strpbrk() call that sanitizes all problematic characters (/, , :, ") at once. This is both a fix and a simplification.
See patch: 0001-selftests-bpf-Sanitize-colons-in-traffic-monitor-pca.patch
- while ((p = strchr(buf, '/')))
- *p = '_';
- while ((p = strchr(buf, ' ')))
+ while ((p = strpbrk(buf, " /:\"")))
*p = '_';Impact
Without the fix, every CI run's parallel test jobs (test_progs_parallel and test_progs_no_alu32_parallel) fail at the artifact upload step. While these parallel jobs use continue_on_error: true so they don't block the overall CI run, they still produce a "failure" status that:
- Degrades CI signal quality (2 false failures per run)
- Makes it harder to notice genuine regressions in parallel test results
- Wastes developer time investigating false failures
References
tools/testing/selftests/bpf/network_helpers.c:1137—encode_test_name()functiontools/testing/selftests/bpf/prog_tests/net_timestamping.c:231— subtests with colons- Commit
f4924aec58dd— introducednet_timestampingtest with colon-containing subtest names - Commit
f52403b6bfea— introducedencode_test_name()and traffic monitor filename generation - GitHub Actions artifact upload character restrictions:
",:,<,>,|,*,?