Skip to content

Commit dfa12b1

Browse files
DavudSafarliory-bot
authored andcommitted
fix: flaky keto test
GitOrigin-RevId: f2b4202ea63450586823c41f8ca78e6b4b148b30
1 parent 4541f0e commit dfa12b1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/status/root_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestStatusCmd(t *testing.T) {
3434
ts.Cmd.PersistentArgs = append(ts.Cmd.PersistentArgs, "--"+cmdx.FlagQuiet, "--"+FlagEndpoint, string(serverType))
3535

3636
t.Run("case=timeout,noblock", func(t *testing.T) {
37-
ctx, cancel := context.WithTimeout(context.Background(), time.Microsecond)
37+
ctx, cancel := context.WithDeadline(t.Context(), time.Now().Add(-time.Second))
3838
defer cancel()
3939

4040
stdErr := cmdx.ExecExpectedErrCtx(ctx, t, newStatusCmd(), "--"+FlagEndpoint, string(serverType), "--"+ts.FlagRemote, ts.Addr[:len(ts.Addr)-1])
@@ -47,7 +47,7 @@ func TestStatusCmd(t *testing.T) {
4747
})
4848

4949
t.Run("case=block", func(t *testing.T) {
50-
ctx := context.WithValue(context.Background(), client.ContextKeyTimeout, 100*time.Millisecond)
50+
ctx := context.WithValue(t.Context(), client.ContextKeyTimeout, 100*time.Millisecond)
5151

5252
l, err := net.Listen("tcp", "127.0.0.1:0")
5353
require.NoError(t, err)

0 commit comments

Comments
 (0)