Skip to content

Commit 81a2f49

Browse files
committed
Added integration test
1 parent 7bdee7a commit 81a2f49

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

internal/integrationtest/daemon/daemon_test.go

+18
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,24 @@ func TestArduinoCliDaemon(t *testing.T) {
9191

9292
testWatcher()
9393
testWatcher()
94+
95+
{
96+
// Test that the watcher stays open until the grpc call is canceled
97+
98+
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
99+
defer cancel()
100+
101+
start := time.Now()
102+
watcher, err := grpcInst.BoardListWatch(ctx)
103+
require.NoError(t, err)
104+
for {
105+
_, err := watcher.Recv()
106+
if err != nil {
107+
break
108+
}
109+
}
110+
require.Greater(t, time.Since(start), 2*time.Second)
111+
}
94112
}
95113

96114
func TestDaemonAutoUpdateIndexOnFirstInit(t *testing.T) {

0 commit comments

Comments
 (0)