Add test for releasing connections back to the server

This commit is contained in:
2025-08-22 13:10:26 -04:00
parent 7860e720bd
commit 1a85e91113
9 changed files with 168 additions and 42 deletions

View File

@@ -298,7 +298,16 @@ This write-side component is designed to integrate with:
- **Configuration**: All configuration is TOML-based using `config.toml` (see `config.md`)
- **Testing Strategy**: Run unit tests, benchmarks, and debug tools before submitting changes
- **Build System**: CMake generates gperf hash tables at build time; always use ninja
- **Test Synchronization**: NEVER use sleep() for test synchronization - it makes tests slow and flaky. Use proper synchronization primitives like std::latch (C++20), condition variables, or promises/futures instead
- **Test Synchronization**:
- **ABSOLUTELY NEVER use sleep(), std::this_thread::sleep_for(), or any timeout-based waiting in tests**
- **NEVER use condition_variable.wait_for() or other timeout variants**
- Use deterministic synchronization only:
- **Blocking I/O** (blocking read/write calls that naturally wait)
- **condition_variable.wait()** with no timeout (waits indefinitely until condition is met)
- **std::latch, std::barrier, futures/promises** for coordination
- **RAII guards and resource management** for cleanup
- Tests should either pass (correct) or hang forever (indicates real bug to investigate)
- No timeouts, no flaky behavior, no false positives/negatives
---