Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,12 @@ func TestSendTelemetry(t *testing.T) {
func TestCloseTelemetryConnection(t *testing.T) {
tb.Cancel()
time.Sleep(300 * time.Millisecond)

tb.mutex.Lock()
if len(tb.connections) != 0 {
t.Errorf("server didn't close connection")
}
tb.mutex.Unlock()
}

func TestServerCloseTelemetryConnection(t *testing.T) {
Expand All @@ -218,9 +221,11 @@ func TestServerCloseTelemetryConnection(t *testing.T) {
t.Errorf("Client couldn't recognise server close")
}

tb.mutex.Lock()
if len(tb.connections) != 0 {
t.Errorf("All connections not closed as expected")
}
tb.mutex.Unlock()

// Close client connection
tb1.Close()
Expand Down Expand Up @@ -248,9 +253,11 @@ func TestClientCloseTelemetryConnection(t *testing.T) {
tb1.Close()
time.Sleep(300 * time.Millisecond)

tb.mutex.Lock()
if len(tb.connections) != 0 {
t.Errorf("All connections not closed as expected")
}
tb.mutex.Unlock()

// Exit server thread and close server connection
tb.Cancel()
Expand Down