Commit ca47633
Add test verifying global auto-flush accumulation across tables
The test covers the scenario where rows are written to multiple tables
interleaved (t1, t2, t1, t2, ...) to confirm that auto-flush counts
rows globally rather than per-table. A bug was reported where auto-flush
seemed to trigger on each table switch instead of accumulating the
configured total number of rows.
The new test (testAutoFlushAccumulatesRowsAcrossAllTables) uses
autoFlushRows=5 with bytes and interval checks disabled, writes 4
interleaved rows across two tables, and asserts:
- No flush happens on any of the 4 rows (including table switches)
- pendingRowCount reflects the total across all tables
- The 5th row triggers the flush by hitting the global row threshold
The test confirms the code is correct: QwpWebSocketSender accumulates
rows globally via pendingRowCount and shouldAutoFlush() checks that
counter against autoFlushRows, with no flush logic in table().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 58df95f commit ca47633
1 file changed
Lines changed: 49 additions & 0 deletions
File tree
- core/src/test/java/io/questdb/client/test/cutlass/qwp/client
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 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 | + | |
48 | 97 | | |
49 | 98 | | |
50 | 99 | | |
| |||
0 commit comments