Skip to content

Commit

Permalink
go: sqle/binlogreplication: Add some waits for more reliable observat…
Browse files Browse the repository at this point in the history
…ions of IO_error results.
  • Loading branch information
reltuk committed Feb 4, 2025
1 parent b4b6d71 commit 6d95550
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestBinlogPrimary_BinlogNotEnabled(t *testing.T) {
h.requirePrimaryResults("SHOW BINARY LOGS", [][]any{})

h.startReplicationAndCreateTestDb(h.doltPort)
time.Sleep(1 * time.Second)
status := h.queryReplicaStatus()
require.Equal(t, "13120", status["Last_IO_Errno"])
require.Contains(t, status["Last_IO_Error"],
Expand All @@ -71,7 +72,7 @@ func TestBinlogPrimary_GtidModeNotEnabled(t *testing.T) {
h.requirePrimaryResults("SHOW BINARY LOGS", [][]any{{"binlog-main.000001", "151", "No"}})

h.startReplication(h.doltPort)
time.Sleep(500 * time.Millisecond)
time.Sleep(1 * time.Second)
status := h.queryReplicaStatus()
require.Equal(t, "13117", status["Last_IO_Errno"])
require.Contains(t, status["Last_IO_Error"],
Expand All @@ -90,7 +91,7 @@ func TestBinlogPrimary_EnforceGtidConsistencyNotEnabled(t *testing.T) {
h.requirePrimaryResults("SHOW BINARY LOGS", [][]any{{"binlog-main.000001", "151", "No"}})

h.startReplication(h.doltPort)
time.Sleep(500 * time.Millisecond)
time.Sleep(1 * time.Second)
status := h.queryReplicaStatus()
require.Equal(t, "13114", status["Last_IO_Errno"])
require.Contains(t, status["Last_IO_Error"],
Expand Down Expand Up @@ -257,6 +258,7 @@ func TestBinlogPrimary_AutoPurging(t *testing.T) {

// Verify the replica reports an error about the GTIDs not being available
h.startReplicationAndCreateTestDb(h.doltPort)
time.Sleep(1 * time.Second)
status := h.queryReplicaStatus()
require.Equal(t, "13114", status["Last_IO_Errno"])
require.Contains(t, status["Last_IO_Error"],
Expand Down Expand Up @@ -394,6 +396,7 @@ func TestBinlogPrimary_Heartbeats(t *testing.T) {
[][]any{{fmt.Sprintf("%d", maxInsertValue)}})

// Make sure no errors have occurred
time.Sleep(1 * time.Second)
status := h.queryReplicaStatus()
require.Equal(t, "", status["Last_SQL_Error"])
require.Equal(t, "", status["Last_IO_Error"])
Expand Down

0 comments on commit 6d95550

Please sign in to comment.