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

we can get double events so double errors; also it can take a while to get events,... so sleep 3s #53

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions configmap/loglevel_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func TestDynamicLogLevelAndBinaryFlag(t *testing.T) {
if err = os.WriteFile(binaryFlag, []byte{1, 2, 3, 4, 5}, 0o644); err != nil {
t.Fatalf("unable to write %v: %v", binaryFlag, err)
}
time.Sleep(2 * time.Second)
assert.Equal(t, u.Errors(), 1, "should have 1 error picked up as we wrote > 4 bytes")
time.Sleep(3 * time.Second)
// We might get more than 1 event for some reasons, so more than 1 error
errCount := u.Errors()
if errCount < 1 {
t.Errorf("Expected at least 1 error because we wrote more than validator accepts, got %d", errCount)
}
}