aperture icon indicating copy to clipboard operation
aperture copied to clipboard

hashmail: fix flacky tests

Open starius opened this issue 1 month ago • 0 comments

Summary

  • make RequestReadStream/RequestWriteStream wait for their respective channels (bounded by streamAcquireTimeout and respecting context) instead of immediately returning "stream occupied", removing the race that caused TestHashMailServerReturnStream to flake

  • ensure setupAperture stops its Aperture instance via t.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's NewCipherBox call to hit AlreadyExists

Testing

  • go test -run 'TestHashMailServer(ReturnStream|LargeMessage)' -count=20

starius avatar Nov 27 '25 01:11 starius