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

chore: increase timeout values #2719

Merged
merged 1 commit into from
Aug 12, 2024
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
2 changes: 1 addition & 1 deletion logconsumer_test.go
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ func TestContainerLogWithErrClosed(t *testing.T) {
if errors.Is(err, context.DeadlineExceeded) {
break
}
time.Sleep(100 * time.Microsecond)
time.Sleep(10 * time.Millisecond)
t.Log("retrying get endpoint")
}
if err != nil {
12 changes: 6 additions & 6 deletions wait/log_test.go
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ func TestWaitForLog(t *testing.T) {
target := NopStrategyTarget{
ReaderCloser: io.NopCloser(bytes.NewReader([]byte("docker"))),
}
wg := NewLogStrategy("docker").WithStartupTimeout(100 * time.Microsecond)
wg := NewLogStrategy("docker").WithStartupTimeout(100 * time.Millisecond)
err := wg.WaitUntilReady(context.Background(), target)
if err != nil {
t.Fatal(err)
@@ -39,7 +39,7 @@ func TestWaitForLog(t *testing.T) {
}

// get all words that start with "ip", end with "m" and has a whitespace before the "ip"
wg := NewLogStrategy(`\sip[\w]+m`).WithStartupTimeout(100 * time.Microsecond).AsRegexp()
wg := NewLogStrategy(`\sip[\w]+m`).WithStartupTimeout(100 * time.Millisecond).AsRegexp()
err := wg.WaitUntilReady(context.Background(), target)
if err != nil {
t.Fatal(err)
@@ -53,7 +53,7 @@ func TestWaitWithExactNumberOfOccurrences(t *testing.T) {
ReaderCloser: io.NopCloser(bytes.NewReader([]byte("kubernetes\r\ndocker\n\rdocker"))),
}
wg := NewLogStrategy("docker").
WithStartupTimeout(100 * time.Microsecond).
WithStartupTimeout(100 * time.Millisecond).
WithOccurrence(2)
err := wg.WaitUntilReady(context.Background(), target)
if err != nil {
@@ -69,7 +69,7 @@ func TestWaitWithExactNumberOfOccurrences(t *testing.T) {
// get texts from "ip" to the next "m".
// there are three occurrences of this pattern in the string:
// one "ipsum mauris" and two "ipsum dolor sit am"
wg := NewLogStrategy(`ip(.*)m`).WithStartupTimeout(100 * time.Microsecond).AsRegexp().WithOccurrence(3)
wg := NewLogStrategy(`ip(.*)m`).WithStartupTimeout(100 * time.Millisecond).AsRegexp().WithOccurrence(3)
err := wg.WaitUntilReady(context.Background(), target)
if err != nil {
t.Fatal(err)
@@ -98,7 +98,7 @@ func TestWaitWithExactNumberOfOccurrencesButItWillNeverHappen(t *testing.T) {

// get texts from "ip" to the next "m".
// there are only three occurrences matching
wg := NewLogStrategy(`do(.*)ck.+`).WithStartupTimeout(100 * time.Microsecond).AsRegexp().WithOccurrence(4)
wg := NewLogStrategy(`do(.*)ck.+`).WithStartupTimeout(100 * time.Millisecond).AsRegexp().WithOccurrence(4)
err := wg.WaitUntilReady(context.Background(), target)
if err == nil {
t.Fatal("expected error")
@@ -127,7 +127,7 @@ func TestWaitShouldFailWithExactNumberOfOccurrences(t *testing.T) {

// get "Maecenas".
// there are only one occurrence matching
wg := NewLogStrategy(`^Mae[\w]?enas\s`).WithStartupTimeout(100 * time.Microsecond).AsRegexp().WithOccurrence(2)
wg := NewLogStrategy(`^Mae[\w]?enas\s`).WithStartupTimeout(100 * time.Millisecond).AsRegexp().WithOccurrence(2)
err := wg.WaitUntilReady(context.Background(), target)
if err == nil {
t.Fatal("expected error")