aperture
aperture copied to clipboard
hashmail: fix flacky tests
Summary
-
make
RequestReadStream/RequestWriteStreamwait for their respective channels (bounded bystreamAcquireTimeoutand respecting context) instead of immediately returning "stream occupied", removing the race that causedTestHashMailServerReturnStreamto flake -
ensure
setupAperturestops its Aperture instance viat.Cleanup, so each test tears down its server even when it fails midway; this prevents one test from leaving a live HashMail stream that causes the next test'sNewCipherBoxcall to hitAlreadyExists
Testing
go test -run 'TestHashMailServer(ReturnStream|LargeMessage)' -count=20