Skip to content

Commit

Permalink
Fix test after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jakule committed Jun 9, 2023
1 parent 611dfd7 commit 4940bda
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/web/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,16 @@ func TestExecuteCommandHistory(t *testing.T) {

ws, _, err := s.makeCommand(t, authPack, conversationID)
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, ws.Close()) })

stream := NewWStream(ws)
stream := NewWStream(ctx, ws, utils.NewLoggerForTests(), nil)

// When command executes
require.NoError(t, waitForCommandOutput(stream, "teleport"))

// Explecitly close the stream
err = stream.Close()
require.NoError(t, err)

// Then command execution history is saved
var messages *assist.GetAssistantMessagesResponse
// Command execution history is saved in asynchronusly, so we need to wait for it.
Expand All @@ -103,7 +106,7 @@ func TestExecuteCommandHistory(t *testing.T) {
require.NoError(t, err)

return len(messages.GetMessages()) == 1
}, 3*time.Second, 100*time.Millisecond)
}, 5*time.Second, 100*time.Millisecond)

// Assert the returned message
msg := messages.GetMessages()[0]
Expand Down

0 comments on commit 4940bda

Please sign in to comment.