Skip to content

test: trim the suite - #74

Merged
HaoZeke merged 8 commits into
developfrom
test/trim-suite
Nov 26, 2026
Merged

HaoZeke merged 8 commits into
developfrom
test/trim-suite

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Commits:

  • test: drop checks that repeat a contract already run
  • test: fold near-copy checks into one table each
  • test: record syslog frames in a buffer
  • test: shrink fixtures that were larger than the check
  • test: make the timing-sensitive checks deterministic
  • test: write the syslog capture from both tools
  • test: match each captured frame to the message pattern

The two captures carry different timestamps. The length
equals the octet count. The pattern matches the payload.
The datagram matches the pattern. The datagram has no
length prefix.

Each removed check repeats a contract another test already
runs, or it pins a string that is not a program contract.
`tests/test_output_stability.sh` keeps the kept-log compare.
`tests/differential.sh` drops the report compares that only
ask `COMPAT.md` to name the command. It also drops the
matching unit tests.

The suite loses 76 tests: 22 Zig `test` blocks and 54 shell
checks.
The six `why` failure rows become one table. The wrap pair
becomes one table. The output-style cases share a single
check. The tmpdir cases share one check. The nine schema
commands share one table. The glob rows join the
`parsePolicy` test. The three zone rows join the `glibc`
rule table. The `-h` check uses the same command-line
reference as `--help`.

36 checks become 5 tables. 3 rows join tests that already
existed. The suite loses 31 tests.
`EB_KEEP_LOGS_SYSLOG_CAPTURE` stores the framed write that
`--syslog` would send. The test opens no Transmission
Control Protocol socket and no User Datagram Protocol
socket. The octet count is `N` plus the payload. The User
Datagram Protocol buffer is that payload as one datagram.
The local-socket datagram tests still check the `RFC 5424` text.

The same one test reads a buffer instead of `127.0.0.1`.
Rotation races use short logs. One locked round runs. Two
rounds meet at a gzip barrier while the lock is off. The
test releases the lock, and the waiting rotate runs. The
test checks `gunzip` on two windows of input. The test
drains a silent syslog socket once after `wait`, and the
read returns without waiting.

The five checks keep the same assertions and drop the long
inputs.
The mid-compress compare kills the shell side when its gzip
input closes. `EB_KEEP_LOGS_TEST_KILL_AT=mid-copy` kills the
Zig side in the test-ops binary. The test freezes
`EB_KEEP_LOGS_CLOCK` while the rotate waits for the lock.
The test then jumps the timestamp. A monotonic clock
measures `--lock-timeout`, with a 50 millisecond early
allowance. The `flock` waiter records `EINTR` on a pipe
before the helper releases the lock.

The four checks avoid a sleep used as a wait. The timeouts
stay the same.
The shell emitter writes that capture file. The Zig
emitter writes the file the same way. The binary reads
the clock file from `/proc/self/environ`. The binary
links no `libc`.
The two captures carry different timestamps. The length
equals the octet count. The pattern matches the payload.
The datagram matches the pattern. The datagram has no
length prefix.
Two rotates with the lock off meet in the gzip stand-in before
either compresses. The stand-in opened `go` as a fifo. That open
blocks until the other end is open. Both gzip processes stayed
there, and `wait` never returned.

The second rotate writes a regular file. The first polls for that
file, then both run the real gzip.
@HaoZeke
HaoZeke merged commit fb8bbd3 into develop Nov 26, 2026
8 checks passed
HaoZeke added a commit that referenced this pull request Nov 26, 2026
The develop merge brought back `--help` checks, `failed` and `rotate`
stability checks with their goldens, and nine case goldens that #74
removed. Drop them again.
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.

1 participant