Open rubenv opened 12 months ago
Good catch, thanks!
Probably this was the reason :) https://github.com/allegro/bigcache/actions/runs/6145556141/job/16673759956?pr=374#step:5:25
I honestly have no idea why it would cause that.
AFAIR it's because during a test run os.Stdout
is replaced with a test-specific writer to catch the full output. And because this we're logging in a goroutine we can log after a test end, which results in a panic due to Go test cleanup.
If you're curious to fix it than try to replace this context with context.WithCancel(...)
https://github.com/allegro/bigcache/blob/157556c5afaeebd739cdbff4755e65f88a5d95af/examples_test.go#L63
And if you're not curious (which is fine too) I will take a look later today (leaving PR open for some time).
Thanks.
@rubenv Ping
Uses the configured logger instead.