Commit 711a7eb
test: optimize test_fast_shutdown with event-based synchronization
Replace sleep-based timing with proper Event synchronization:
- Remove executor_init with 0.5s sleep
- Replace time.sleep(0.5) with connection_created.wait()
- Replace time.sleep(3) with executor.shutdown(wait=True)
- Reduce iterations from 20 to 3 (deterministic with proper sync)
- Add explicit assertions for shutdown state
Performance improvement:
- Before: 70.13s call tests/unit/test_host_connection_pool.py::HostConnectionTests::test_fast_shutdown
- After: 0.01s call tests/unit/test_host_connection_pool.py::HostConnectionTests::test_fast_shutdown
Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>1 parent 472461c commit 711a7eb
1 file changed
Lines changed: 19 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 267 | + | |
| 268 | + | |
271 | 269 | | |
272 | 270 | | |
273 | | - | |
| 271 | + | |
274 | 272 | | |
275 | 273 | | |
276 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
277 | 280 | | |
278 | | - | |
| 281 | + | |
| 282 | + | |
279 | 283 | | |
280 | | - | |
281 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
0 commit comments