-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Currently, the port_in_use?
and wait_for_port_to_be_available
helper methods in E2eTestRunner
are only tested indirectly through integration tests. We should add explicit unit tests for these methods to ensure better test coverage and catch edge cases.
Proposed Changes
Test Coverage Needed:
-
port_in_use?
method tests:- Port is available (can bind successfully)
- Port is in use (Errno::EADDRINUSE)
- Other socket errors are handled gracefully
- TCPServer is always closed (resource leak prevention)
-
wait_for_port_to_be_available
method tests:- Port becomes available immediately
- Port becomes available after several attempts
- Port never becomes available (timeout)
- Progress indicators are printed correctly
- Warning message when port remains in use
Benefits:
- Better test coverage for critical infrastructure code
- Easier to identify and fix edge cases
- Documents expected behavior explicitly
- Faster feedback loop (unit tests run faster than integration tests)
Related
- Part of test infrastructure improvements from Medium Priority: Add timeouts, port polling, and cleanup incomplete implementations #15
- Builds on work done in PR Refactor code quality improvements #24
Priority
Nice to have - Current indirect testing is adequate but explicit tests would improve maintainability.
Metadata
Metadata
Assignees
Labels
No labels