Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish racing tests, fix edge cases they revealed
Edge case issues fixed: 1. handleCheckpoint was invoking the retry policy's Decide method on attempts that were cancelled as redundant. 2. Wave cleanup code would deadlock if multiple instances of the sendAndReadBody goroutine panicked concurrently. 3. attemptState goroutine's recoverPanic wasn't resilient to a secondary panic from closing the response body. ----------------------------------------------------------------------- Checkpoint: As of this commit, the tests pass reliably at least up to 10K iterations on my Windows laptop, in just over 3 hours. C:\...\httpx>go test -count=10000 -cover -timeout=14h PASS coverage: 98.0% of statements ok github.com/gogama/httpx 10887.090s ----------------------------------------------------------------------- The only two significant uncovered lines in `client.go` are line 318 (the channel read in setTimer, somewhat surprising to me), and line 388 (the fallthrough branch in the switch statemenet in cleanupWave (this isn't surprising, it's a small bit of missing test coverage).
- Loading branch information