Skip to content

Commit 0f8c211

Browse files
committed
WaitSuperLong
1 parent 46122f2 commit 0f8c211

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

loadtest/reconnectingpty/run_test.go

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package reconnectingpty_test
33
import (
44
"bytes"
55
"context"
6-
"runtime"
76
"testing"
87
"time"
98

@@ -23,9 +22,6 @@ import (
2322

2423
func Test_Runner(t *testing.T) {
2524
t.Parallel()
26-
if runtime.GOOS != "linux" {
27-
t.Skip("PTY is flakey on non-Linux platforms")
28-
}
2925

3026
t.Run("OK", func(t *testing.T) {
3127
t.Parallel()
@@ -40,7 +36,7 @@ func Test_Runner(t *testing.T) {
4036
LogOutput: true,
4137
})
4238

43-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
39+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
4440
defer cancel()
4541

4642
logs := bytes.NewBuffer(nil)
@@ -68,7 +64,7 @@ func Test_Runner(t *testing.T) {
6864
LogOutput: false,
6965
})
7066

71-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
67+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
7268
defer cancel()
7369

7470
logs := bytes.NewBuffer(nil)
@@ -93,11 +89,11 @@ func Test_Runner(t *testing.T) {
9389
Init: codersdk.ReconnectingPTYInit{
9490
Command: "echo 'hello world'",
9591
},
96-
Timeout: httpapi.Duration(2 * testutil.WaitLong),
92+
Timeout: httpapi.Duration(2 * testutil.WaitSuperLong),
9793
LogOutput: true,
9894
})
9995

100-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
96+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
10197
defer cancel()
10298

10399
logs := bytes.NewBuffer(nil)
@@ -121,7 +117,7 @@ func Test_Runner(t *testing.T) {
121117
LogOutput: true,
122118
})
123119

124-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
120+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
125121
defer cancel()
126122

127123
logs := bytes.NewBuffer(nil)
@@ -151,7 +147,7 @@ func Test_Runner(t *testing.T) {
151147
LogOutput: true,
152148
})
153149

154-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
150+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
155151
defer cancel()
156152

157153
logs := bytes.NewBuffer(nil)
@@ -171,12 +167,12 @@ func Test_Runner(t *testing.T) {
171167
Init: codersdk.ReconnectingPTYInit{
172168
Command: "echo 'hello world'",
173169
},
174-
Timeout: httpapi.Duration(2 * testutil.WaitLong),
170+
Timeout: httpapi.Duration(2 * testutil.WaitSuperLong),
175171
ExpectTimeout: true,
176172
LogOutput: true,
177173
})
178174

179-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
175+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
180176
defer cancel()
181177

182178
logs := bytes.NewBuffer(nil)
@@ -205,7 +201,7 @@ func Test_Runner(t *testing.T) {
205201
LogOutput: false,
206202
})
207203

208-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
204+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
209205
defer cancel()
210206

211207
logs := bytes.NewBuffer(nil)
@@ -229,7 +225,7 @@ func Test_Runner(t *testing.T) {
229225
LogOutput: false,
230226
})
231227

232-
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
228+
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
233229
defer cancel()
234230

235231
logs := bytes.NewBuffer(nil)

testutil/duration.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import "time"
77
// Constants for timing out operations, usable for creating contexts
88
// that timeout or in require.Eventually.
99
const (
10-
WaitShort = 5 * time.Second
11-
WaitMedium = 10 * time.Second
12-
WaitLong = 15 * time.Second
10+
WaitShort = 5 * time.Second
11+
WaitMedium = 10 * time.Second
12+
WaitLong = 15 * time.Second
13+
WaitSuperLong = 30 * time.Second
1314
)
1415

1516
// Constants for delaying repeated operations, e.g. in

0 commit comments

Comments
 (0)