Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Jan 15, 2026

refactor tests to use testing/synctest (Go 1.25)

Note

Most of diff is just indentation, it may be easier to review by ignoring whitespace changes:

image

refactor tests to use testing/synctest (Go 1.25) to fix data race
where test code read from ResponseRecorder while middleware's
internal goroutines were still writing.
@lidel lidel requested a review from gammazero January 15, 2026 18:35
@lidel lidel changed the title test(gateway): fix rare flaky timeout tests test(gateway): rewrite rare flaky timeout tests to testing/synctest Jan 15, 2026
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.10%. Comparing base (cb255cb) to head (d21e15b).
⚠️ Report is 1 commits behind head on main.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1087   +/-   ##
=======================================
  Coverage   61.10%   61.10%           
=======================================
  Files         264      264           
  Lines       26217    26217           
=======================================
  Hits        16021    16021           
- Misses       8518     8519    +1     
+ Partials     1678     1677    -1     

see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lidel lidel changed the title test(gateway): rewrite rare flaky timeout tests to testing/synctest test(gateway): rewrite some to testing/synctest Jan 15, 2026
@lidel lidel changed the title test(gateway): rewrite some to testing/synctest refactor: rewrite some flaky tests to testing/synctest Jan 15, 2026
…g/synctest

refactor test to use testing/synctest (Go 1.25) to fix race condition
where test code called AddCancels before the message queue goroutine
finished marking items as "sent" in its internal state.
@lidel lidel marked this pull request as ready for review January 15, 2026 19:14
@lidel lidel requested a review from a team as a code owner January 15, 2026 19:14
@gammazero gammazero merged commit b89a172 into main Jan 21, 2026
17 checks passed
@gammazero gammazero deleted the fix/synctest-retrieval-timeout-tests branch January 21, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants