Skip to content

Fix flaky TestCatFileBatch/QueryTerminated test (#37159)#37178

Merged
silverwind merged 1 commit intogo-gitea:release/v1.26from
GiteaBot:backport-37159-v1.26
Apr 11, 2026
Merged

Fix flaky TestCatFileBatch/QueryTerminated test (#37159)#37178
silverwind merged 1 commit intogo-gitea:release/v1.26from
GiteaBot:backport-37159-v1.26

Conversation

@GiteaBot
Copy link
Copy Markdown
Collaborator

Backport #37159 by @silverwind

TestCatFileBatch/QueryTerminated relied on timing to distinguish os.ErrClosed vs io.EOF error paths. Replace time.Sleep-based synchronization with a channel-based hook on pipe close, making both error paths fully deterministic regardless of CI runner speed.

Ref: https://github.com/go-gitea/gitea/actions/runs/24193070536/job/70615366804


This PR was written with the help of Claude Opus 4.6

`TestCatFileBatch/QueryTerminated` relied on timing to distinguish
`os.ErrClosed` vs `io.EOF` error paths. Replace `time.Sleep`-based
synchronization with a channel-based hook on pipe close, making both
error paths fully deterministic regardless of CI runner speed.

Ref: https://github.com/go-gitea/gitea/actions/runs/24193070536/job/70615366804
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 11, 2026
@GiteaBot GiteaBot added this to the 1.26.0 milestone Apr 11, 2026
@GiteaBot GiteaBot requested review from lunny and wxiaoguang April 11, 2026 10:42
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 11, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 11, 2026
@silverwind silverwind merged commit 0112ec9 into go-gitea:release/v1.26 Apr 11, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants