Skip to content

gocache/awscache: fix flaky TestDiskSpool - #17

Merged
tomhjp merged 1 commit into
mainfrom
tomhjp/awscache-diskspool-flake
Nov 9, 2026
Merged

tomhjp merged 1 commit into
mainfrom
tomhjp/awscache-diskspool-flake

Conversation

@tomhjp

@tomhjp tomhjp commented Nov 9, 2026

Copy link
Copy Markdown
Member

The GET handler closes its spool in a deferred call after io.Copy returns. The client has the full body when it gets Content-Length bytes, so wantHit can return before the spool is closed. Close the test server before the test checks the spool dir to make sure all outstanding requests are drained first.

Updates #cleanup

The GET handler closes its spool in a deferred call after io.Copy
returns. The client has the full body when it gets Content-Length
bytes, so wantHit can return before the spool is closed. Close the
test server before the test checks the spool dir to make sure all
outstanding requests are drained first.

Updates #cleanup
@tomhjp
tomhjp requested a review from a team November 9, 2026 19:04
@tomhjp

tomhjp commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

This test flaked a couple of times for me on #16

@runewake2 runewake2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tomhjp
tomhjp merged commit b77e962 into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants