Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flaky URLConnectionTest.serverShutdownOutput test
There are usually 2 requests sent to '/b' during the test: square#1 on the busted connection, attempting reuse square#2 on a new connection On successful runs, the server records square#1 and then square#2 and adds them to the queue in that order. On failed runs, the server starts reading request square#1 before square#2, but there is a context switch, and it finishes reading square#2 before square#1, recording them in that order. Since square#1 is the last to be recorded, the test incorrectly uses it to assert that the sequence number is 0. Since square#1 was the second to be received on the busted connection, it has a sequence number of 1 so the test fails. The fix asserts that either square#1 or square#2 has a sequence number of 0.
- Loading branch information