Commit 8207589
opencode
fix(tests): wait for active connection count to reach expected value in ConnectionPoolReconnectsTest
box.stat.net().CONNECTIONS.current is updated asynchronously by the IProto
worker and closing the administrative net.box connection used by
executeCommandDecoded is asynchronous on the server, so a single read can
briefly observe a stale or transitional value. This made the absolute
assertion `assertEquals(count1, getActiveConnectionsCount(tt))` flaky when
timings shifted (e.g. under docker emulation locally and on the self-hosted
3.5.0 runner), producing `expected: <11> but was: <12>`.
Add a waitForActiveConnections(tt, expected) helper in BasePoolTest that
retries the assertion via the existing waitFor() loop, and use it in
ConnectionPoolReconnectsTest#testReconnectAfterNodeFailure at both
assertion sites (initial connect and post-reconnect). Other tests
(ConnectionPoolTest, ConnectionPoolHeartbeatTest) are unaffected as they
use the established baseline+delta pattern or pass in CI.
Verified locally on 3.5.0:
- ConnectionPoolReconnectsTest: 10/10 PASS (previously flaky)
- Full box-integration target modules: 0 failures1 parent 35bd47c commit 8207589
2 files changed
Lines changed: 25 additions & 2 deletions
File tree
- tarantool-pooling/src/test/java/io/tarantool/pool/integration
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
120 | 143 | | |
121 | 144 | | |
122 | 145 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
0 commit comments