Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit aab0906

Browse files
authored
Fix flaky agentprotocol test (#538)
Both testing threads called the Kill() function at the same time which caused them to deadlock as they both were trying to send the termination packet to each-other at the same time. In a real situation this would not cause a deadlock as the communication between the two sides would be buffered. Signed-off-by: Nikos Tsipinakis <nikos@tsipinakis.com>
1 parent 32cc4c0 commit aab0906

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

agentprotocol/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ func TestConnectionSetup(t *testing.T) {
9595
t.Fatalf("Expected to read 'Message to server' instead got %s", string(buf[:nBytes]))
9696
}
9797
_ = testConClient.Close()
98-
close(closeChan)
9998
clientCtx.Kill()
99+
close(closeChan)
100100
}

0 commit comments

Comments
 (0)