From a8d2cbd9cb0f1a4a3840f05ffaa6142f17b1d057 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Mon, 17 Feb 2025 16:40:16 +0530 Subject: [PATCH] test: poll the new gauge in the test Signed-off-by: Manan Gupta --- .../reparent/newfeaturetest/reparent_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/go/test/endtoend/reparent/newfeaturetest/reparent_test.go b/go/test/endtoend/reparent/newfeaturetest/reparent_test.go index 1db03f213a1..81c66ebb05e 100644 --- a/go/test/endtoend/reparent/newfeaturetest/reparent_test.go +++ b/go/test/endtoend/reparent/newfeaturetest/reparent_test.go @@ -280,7 +280,7 @@ func TestSemiSyncBlockDueToDisruption(t *testing.T) { ch := make(chan any) go func() { defer func() { - ch <- true + close(ch) }() utils.ConfirmReplication(t, tablets[0], []*cluster.Vttablet{tablets[1], tablets[2], tablets[3]}) }() @@ -289,6 +289,19 @@ func TestSemiSyncBlockDueToDisruption(t *testing.T) { // on the replica's before the disruption has been introduced. err := clusterInstance.StartVTOrc(clusterInstance.Keyspaces[0].Name) require.NoError(t, err) + go func() { + for { + select { + case <-ch: + return + case <-time.After(1 * time.Second): + str, isPresent := tablets[0].VttabletProcess.GetVars()["SemiSyncMonitorWritesBlocked"] + if isPresent { + log.Errorf("SemiSyncMonitorWritesBlocked - %v", str) + } + } + } + }() // If the network disruption is too long lived, then we will end up running ERS from VTOrc. networkDisruptionDuration := 43 * time.Second time.Sleep(networkDisruptionDuration)