Skip to content

De-flake test_decimate_system#160

Merged
cboulay merged 1 commit into
devfrom
deflake-decimate-system
Jun 26, 2026
Merged

De-flake test_decimate_system#160
cboulay merged 1 commit into
devfrom
deflake-decimate-system

Conversation

@cboulay

@cboulay cboulay commented Jun 26, 2026

Copy link
Copy Markdown
Member

test_decimate_system intermittently fails CI with a shape mismatch (e.g. (100,8) vs (120,8)) — the failure seen on PR #159, unrelated to that PR's changes.

Cause: the raw and decimated streams are logged by two independent MessageLoggers, and the graph is torn down on the output count (TERM watches LOGFILT). Under load the raw logger can capture a message or two more than the filtered logger, so expected (built from all raw samples) ends up longer than outputs, and the full-length np.allclose fails on shape.

Fix: the anti-alias filter is causal and zi-initialized, so each stream is a prefix of a longer run — compare only the overlapping prefix. This is the same truncation test_filter_system already applies for the identical termination race; this just brings the decimate test in line.

No production code touched. test_decimate_system + test_filter_system pass (14, run repeatedly).

The raw and decimated streams are logged by independent MessageLoggers, and the
graph terminates on the output count (TERM watches LOGFILT), so the raw log can
end a message or two ahead of the filtered log. `expected` (built from all raw
samples) was then longer than `outputs`, intermittently failing the full-length
np.allclose with a shape mismatch (e.g. (100,8) vs (120,8)) under CI load.

The anti-alias filter is causal and zi-initialized, so each stream is a prefix
of a longer run; compare only the overlapping prefix. This mirrors the
truncation test_filter_system already applies for the same termination race.
@cboulay cboulay merged commit f6b40f0 into dev Jun 26, 2026
14 checks passed
@cboulay cboulay deleted the deflake-decimate-system branch June 26, 2026 06:09
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