@@ -160,8 +160,9 @@ func TestPortForward(t *testing.T) {
160
160
err = <- errC
161
161
require .ErrorIs (t , err , context .Canceled )
162
162
163
- wuTick <- dbtime .Now ()
164
- <- wuFlush
163
+ flushCtx := testutil .Context (t , testutil .WaitShort )
164
+ testutil .RequireSendCtx (flushCtx , t , wuTick , dbtime .Now ())
165
+ _ = testutil .RequireRecvCtx (flushCtx , t , wuFlush )
165
166
updated , err := client .Workspace (context .Background (), workspace .ID )
166
167
require .NoError (t , err )
167
168
require .Greater (t , updated .LastUsedAt , workspace .LastUsedAt )
@@ -214,8 +215,9 @@ func TestPortForward(t *testing.T) {
214
215
err = <- errC
215
216
require .ErrorIs (t , err , context .Canceled )
216
217
217
- wuTick <- dbtime .Now ()
218
- <- wuFlush
218
+ flushCtx := testutil .Context (t , testutil .WaitShort )
219
+ testutil .RequireSendCtx (flushCtx , t , wuTick , dbtime .Now ())
220
+ _ = testutil .RequireRecvCtx (flushCtx , t , wuFlush )
219
221
updated , err := client .Workspace (context .Background (), workspace .ID )
220
222
require .NoError (t , err )
221
223
require .Greater (t , updated .LastUsedAt , workspace .LastUsedAt )
@@ -281,8 +283,9 @@ func TestPortForward(t *testing.T) {
281
283
err := <- errC
282
284
require .ErrorIs (t , err , context .Canceled )
283
285
284
- wuTick <- dbtime .Now ()
285
- <- wuFlush
286
+ flushCtx := testutil .Context (t , testutil .WaitShort )
287
+ testutil .RequireSendCtx (flushCtx , t , wuTick , dbtime .Now ())
288
+ _ = testutil .RequireRecvCtx (flushCtx , t , wuFlush )
286
289
updated , err := client .Workspace (context .Background (), workspace .ID )
287
290
require .NoError (t , err )
288
291
require .Greater (t , updated .LastUsedAt , workspace .LastUsedAt )
0 commit comments