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.13%. Comparing base (319662c) to head (d5595ce).

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1087      +/-   ##
==========================================
- Coverage   61.18%   61.13%   -0.06%     
==========================================
  Files         264      264              
  Lines       26230    26230              
==========================================
- Hits        16049    16035      -14     
- Misses       8508     8520      +12     
- Partials     1673     1675       +2     

see 13 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
@@ -1,3 +1,5 @@
//go:build go1.25
Copy link
Member Author

@lidel lidel Jan 15, 2026

Choose a reason for hiding this comment

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

@gammazero fysa i went with this, because we already run tests against both 1.24 (go this) and 1.25 (go next), so only running in 1.25+ feels like a good compromise (when go unified CI switches to 1.26 in february, tests will run on both this and next go release again)

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.

2 participants