Skip to content

Commit 5e9440a

Browse files
committed
chore: increase timeout values
Increase timeout values from microseconds to milliseconds as the former can lead to failures depending on hardware.
1 parent 150a48c commit 5e9440a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

logconsumer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func TestContainerLogWithErrClosed(t *testing.T) {
276276
if errors.Is(err, context.DeadlineExceeded) {
277277
break
278278
}
279-
time.Sleep(100 * time.Microsecond)
279+
time.Sleep(10 * time.Millisecond)
280280
t.Log("retrying get endpoint")
281281
}
282282
if err != nil {

wait/log_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestWaitForLog(t *testing.T) {
2626
target := NopStrategyTarget{
2727
ReaderCloser: io.NopCloser(bytes.NewReader([]byte("docker"))),
2828
}
29-
wg := NewLogStrategy("docker").WithStartupTimeout(100 * time.Microsecond)
29+
wg := NewLogStrategy("docker").WithStartupTimeout(100 * time.Millisecond)
3030
err := wg.WaitUntilReady(context.Background(), target)
3131
if err != nil {
3232
t.Fatal(err)
@@ -39,7 +39,7 @@ func TestWaitForLog(t *testing.T) {
3939
}
4040

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

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

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

0 commit comments

Comments
 (0)