Commit f43ee29
Add CapturingOutputSink and worker correctness unit tests
Adds a CapturingOutputSink to output_sink.rs that stores all emitted
(PrecomputedOutput, Box<dyn AggregateCore>) pairs in a Mutex<Vec> for
inspection in tests, alongside drain() and len() helpers.
Adds 6 unit tests in worker.rs covering:
- Raw mode: each sample forwarded as SumAccumulator with sum == value
- Tumbling window: correct boundary and aggregated sum on window close
- Sliding window pane sharing: single sample emits in both overlapping
windows with the correct sum via snapshot/take pane merge
- GROUP BY separate emits: two series on the same worker produce
independent per-series accumulators (no ingest-time cross-series merge)
- Late data Drop: sample behind watermark - allowed_lateness not emitted
- Late data ForwardToStore: late sample for evicted pane emitted as
mini-accumulator with correct window bounds and sum
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 369836c commit f43ee29
3 files changed
Lines changed: 439 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
64 | 101 | | |
65 | 102 | | |
66 | 103 | | |
| |||
0 commit comments