Skip to content

Commit

Permalink
Added integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jul 11, 2024
1 parent 7bdee7a commit 81a2f49
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/integrationtest/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ func TestArduinoCliDaemon(t *testing.T) {

testWatcher()
testWatcher()

{
// Test that the watcher stays open until the grpc call is canceled

ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
defer cancel()

start := time.Now()
watcher, err := grpcInst.BoardListWatch(ctx)
require.NoError(t, err)
for {
_, err := watcher.Recv()
if err != nil {
break
}
}
require.Greater(t, time.Since(start), 2*time.Second)
}
}

func TestDaemonAutoUpdateIndexOnFirstInit(t *testing.T) {
Expand Down

0 comments on commit 81a2f49

Please sign in to comment.