bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.35k stars 635 forks source link

goleak broken by recent timeout changes #3938

Closed DolceTriade closed 1 month ago

DolceTriade commented 1 month ago

What version of rules_go are you using?

0.47.1

What version of gazelle are you using?

latest

What version of Bazel are you using?

bazel 6

Does this issue reproduce with the latest releases of all the above?

yes

What operating system and processor architecture are you using?

Linux amd64

Any other potentially useful information about your toolchain?

not relevant

What did you do?

Ran tests using goleak

What did you expect to see?

successful tests

What did you see instead?

tests failing with a lingering goroutine

This is because in the past we would register the go channel handler in a deterministic location (ie, bzltestutil), but now since its injected into main(), the name depends on the name of the target, which is not deterministic to ignore.

We should bring back the RegisterTimeoutHandler so we have a deterministic location to ignore again.