Skip to content

Commit

Permalink
[receiver/haproxy] Unit test timing out
Browse files Browse the repository at this point in the history
I wasn't able to reproduce the exact situation from CI, but the tests I changed weren't completing at all here. Looking closely, it looks like they never closed the stream, something the first test does. After closing it, the tests start passing locally for me. While I'm not confident this will fix the CI flaky failures, this does make the test work locally for me.

Fixes open-telemetry#32877

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling committed May 8, 2024
1 parent 7a248f5 commit 1f24f72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions receiver/haproxyreceiver/scraper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func Test_scraper_readStatsWithIncompleteValues(t *testing.T) {
require.NoError(t, err2)
_, err2 = c.Write(stats)
require.NoError(t, err2)
require.NoError(t, c.Close())
default:
require.Fail(t, fmt.Sprintf("invalid message: %v", data))
}
Expand Down Expand Up @@ -128,6 +129,7 @@ func Test_scraper_readStatsWithNoValues(t *testing.T) {
require.NoError(t, err2)
_, err2 = c.Write(stats)
require.NoError(t, err2)
require.NoError(t, c.Close())
default:
require.Fail(t, fmt.Sprintf("invalid message: %v", data))
}
Expand Down

0 comments on commit 1f24f72

Please sign in to comment.