Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(routing/mock): wait for goroutine cleanup #619

Merged
merged 1 commit into from
Jun 19, 2024
Merged

Conversation

aschmahmann
Copy link
Contributor

Previously the test was flaky as the goroutine with the log could linger even after the test finished

❯ go test -run TestCanceledContext -count=10000
panic: Log in goroutine after TestCanceledContext has completed: exiting async worker

goroutine 2960 [running]:
testing.(*common).logDepth(0xc00039f040, {0xc000022108, 0x15}, 0x3)
        /go1.22.1/src/testing/testing.go:1028 +0x4c5
testing.(*common).log(...)
        /go1.22.1/src/testing/testing.go:1010
testing.(*common).Log(0xc00039f040, {0xc000637fb8?, 0x1?, 0x1?})
        /go1.22.1/src/testing/testing.go:1051 +0x4a
github.com/ipfs/boxo/routing/mock.TestCanceledContext.func2()
        /boxo/routing/mock/centralized_test.go:98 +0x351
created by github.com/ipfs/boxo/routing/mock.TestCanceledContext in goroutine 2959
        /boxo/routing/mock/centralized_test.go:94 +0x2c5
exit status 2
FAIL    github.com/ipfs/boxo/routing/mock       0.449s

@aschmahmann aschmahmann requested a review from a team as a code owner June 17, 2024 14:29
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.76%. Comparing base (435d838) to head (50b68d0).
Report is 1 commits behind head on main.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #619      +/-   ##
==========================================
+ Coverage   59.70%   59.76%   +0.06%     
==========================================
  Files         239      239              
  Lines       29961    29961              
==========================================
+ Hits        17889    17907      +18     
+ Misses      10453    10438      -15     
+ Partials     1619     1616       -3     

see 15 files with indirect coverage changes

@lidel lidel changed the title [skip changelog] fix(routing/mock): wait for goroutine cleanup fix(routing/mock): wait for goroutine cleanup Jun 19, 2024
@lidel lidel enabled auto-merge (squash) June 19, 2024 14:44
@lidel lidel disabled auto-merge June 19, 2024 14:45
@lidel lidel merged commit aaf9a04 into main Jun 19, 2024
17 checks passed
@lidel lidel deleted the fix/flaky-routing-test branch June 19, 2024 14:45
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.

None yet

2 participants