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

Flaky test #30505

Closed
holiman opened this issue Sep 25, 2024 · 0 comments · Fixed by #30506
Closed

Flaky test #30505

holiman opened this issue Sep 25, 2024 · 0 comments · Fixed by #30506
Labels

Comments

@holiman
Copy link
Contributor

holiman commented Sep 25, 2024

https://ci.appveyor.com/project/ethereum/go-ethereum/builds/50672070/job/3vwt3vsbmg40vmi8#L1114

panic: Log in goroutine after TestUDPv4_LookupIterator has completed: TRACE[09-25|09:29:15.777] << PONG/v4                                id=d89f4c51d8efdaf0 addr=127.0.255.3:5000 err="unsolicited reply"
	
goroutine 36067 [running]:
testing.(*common).logDepth(0xc000116820, {0xc0017a5200, 0x86}, 0x3)
	C:/Users/appveyor/AppData/Local/geth-go-1.23.1-windows-amd64/go/src/testing/testing.go:1029 +0x4c5
testing.(*common).log(...)
	C:/Users/appveyor/AppData/Local/geth-go-1.23.1-windows-amd64/go/src/testing/testing.go:1011
testing.(*common).Logf(0xc000116820, {0x7ff77015f66e?, 0x7ff770400cc0?}, {0xc00055f2a8?, 0xa?, 0xfffffffffffffff8?})
	C:/Users/appveyor/AppData/Local/geth-go-1.23.1-windows-amd64/go/src/testing/testing.go:1062 +0x54
github.com/ethereum/go-ethereum/internal/testlog.(*logger).flush(0xc000643d70)
	C:/projects/go-ethereum/internal/testlog/testlog.go:211 +0x16d
github.com/ethereum/go-ethereum/internal/testlog.(*logger).Trace(0xc000643d70, {0xc0017cc530, 0xa}, {0xc0017b56e0, 0x6, 0x6})
	C:/projects/go-ethereum/internal/testlog/testlog.go:121 +0xd2
github.com/ethereum/go-ethereum/p2p/discover.(*UDPv4).handlePacket(0xc000f902d0, {{{0x0, 0xffff7f00ff03}, {0xc000008048}}, 0x1388}, {0xc001792fc0?, 0x60?, 0xc0017b8c30?})
	C:/projects/go-ethereum/p2p/discover/v4_udp.go:576 +0x4bd
github.com/ethereum/go-ethereum/p2p/discover.(*udpTest).packetInFrom(0xc0000e2690, {0x0, 0x0}, 0xc000025650, {{{0x1df7cde9200?, 0xc00179bd30?}, {0xc000008048?}}, 0x10?}, {0x7ff7701f7270, 0xc0017b5620})
	C:/projects/go-ethereum/p2p/discover/v4_udp_test.go:104 +0x245
github.com/ethereum/go-ethereum/p2p/discover.serveTestnet.func1({0x7ff7701f7248, 0xc0016a3ea0?}, {{{0xc0016a3ea0?, 0xc00055f788?}, {0xc000008048?}}, 0x3ae0?}, {0xc001792ee0, 0x20, 0xe0})
	C:/projects/go-ethereum/p2p/discover/v4_lookup_test.go:143 +0x29e
reflect.Value.call({0x7ff7700f69a0?, 0xc0017bca80?, 0x7ff76fdd123f?}, {0x7ff77015fb0c, 0x4}, {0xc00055ff40, 0x3, 0xc0017bcb10?})
	C:/Users/appveyor/AppData/Local/geth-go-1.23.1-windows-amd64/go/src/reflect/value.go:581 +0xca6
reflect.Value.Call({0x7ff7700f69a0?, 0xc0017bca80?, 0xe0?}, {0xc00055ff40?, 0xcda35b3d79bcd714?, 0xb6253f6da5a12b72?})
	C:/Users/appveyor/AppData/Local/geth-go-1.23.1-windows-amd64/go/src/reflect/value.go:365 +0xb9
github.com/ethereum/go-ethereum/p2p/discover.(*udpTest).waitPacketOut(0xc0000e2690, {0x7ff7700f69a0, 0xc0017bca80})
	C:/projects/go-ethereum/p2p/discover/v4_udp_test.go:132 +0x579
github.com/ethereum/go-ethereum/p2p/discover.serveTestnet(0xc0000e2690, 0x7ff7700c1e80)
	C:/projects/go-ethereum/p2p/discover/v4_lookup_test.go:139 +0x3c
created by github.com/ethereum/go-ethereum/p2p/discover.TestUDPv4_LookupIterator in goroutine 211
	C:/projects/go-ethereum/p2p/discover/v4_lookup_test.go:78 +0x2b5
FAIL	github.com/ethereum/go-ethereum/p2p/discover	112.864s

Fix inbound...

holiman added a commit that referenced this issue Sep 26, 2024
…30506)

This PR fixes two tests, which had a tendency to sometimes write to the `*testing.T` `log` facility after the test function had completed, which is not allowed. This PR fixes it by using waitgroups to ensure that the handler/logwriter terminates before the test exits.

closes #30505
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant