From b04ee0458ad719cf806bc2c5d40420364b99b552 Mon Sep 17 00:00:00 2001 From: Alexandre Gaudreault Date: Fri, 12 Jul 2024 10:21:46 -0400 Subject: [PATCH] clarify comment Signed-off-by: Alexandre Gaudreault --- pkg/cache/cluster_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/cache/cluster_test.go b/pkg/cache/cluster_test.go index 21a8d9071..f5e61a065 100644 --- a/pkg/cache/cluster_test.go +++ b/pkg/cache/cluster_test.go @@ -1047,8 +1047,10 @@ func Test_watchEvents_Deadlock(t *testing.T) { time.Sleep(2 * time.Second) } - //// Uncommenting the following code will simulate a deadlock caused by client code holding a lock and - //// trying to acquire the same lock in the event callback + //// Uncommenting the following code will simulate a different deadlock on purpose caused by + //// client code holding a lock and trying to acquire the same lock in the event callback. + //// It provides an easy way to validate if the test detect deadlocks as expected. + //// If the test fails with this code commented, a deadlock do exist in the codebase. // deadlock.RLock() // defer deadlock.RUnlock()