Skip to content

Commit

Permalink
Fix: Remove SetMaster Query Expectation from ERS Test (#6617)
Browse files Browse the repository at this point in the history
* Removed checks for query lists of replicas. We can't know this for sure because SetMaster calls happen in the background as best effort approach.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Remove outdated comment.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
  • Loading branch information
PrismaPhonic authored Aug 24, 2020
1 parent 42ea442 commit ffa2e29
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions go/vt/wrangler/testlib/emergency_reparent_shard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,27 +171,13 @@ func TestEmergencyReparentShard(t *testing.T) {
waitReplicaTimeout := time.Second * 2
err := vp.Run([]string{"EmergencyReparentShard", "-wait_replicas_timeout", waitReplicaTimeout.String(), newMaster.Tablet.Keyspace + "/" + newMaster.Tablet.Shard,
topoproto.TabletAliasString(newMaster.Tablet.Alias)})
buffer := 100 * time.Millisecond
time.Sleep(waitReplicaTimeout + buffer)
require.NoError(t, err)
// check what was run
err = newMaster.FakeMysqlDaemon.CheckSuperQueryList()
require.NoError(t, err)
err = oldMaster.FakeMysqlDaemon.CheckSuperQueryList()
require.NoError(t, err)
err = goodReplica1.FakeMysqlDaemon.CheckSuperQueryList()
require.NoError(t, err)
err = goodReplica2.FakeMysqlDaemon.CheckSuperQueryList()
require.NoError(t, err)

assert.False(t, newMaster.FakeMysqlDaemon.ReadOnly, "newMaster.FakeMysqlDaemon.ReadOnly set")
// old master read-only flag doesn't matter, it is scrapped
assert.True(t, goodReplica1.FakeMysqlDaemon.ReadOnly, "goodReplica1.FakeMysqlDaemon.ReadOnly not set")
assert.True(t, goodReplica2.FakeMysqlDaemon.ReadOnly, "goodReplica2.FakeMysqlDaemon.ReadOnly not set")
assert.True(t, goodReplica1.FakeMysqlDaemon.Replicating, "goodReplica1.FakeMysqlDaemon.Replicating not set")
assert.False(t, goodReplica2.FakeMysqlDaemon.Replicating, "goodReplica2.FakeMysqlDaemon.Replicating set")
checkSemiSyncEnabled(t, true, true, newMaster)
checkSemiSyncEnabled(t, false, true, goodReplica1, goodReplica2)
}

// TestEmergencyReparentShardMasterElectNotBest tries to emergency reparent
Expand Down

0 comments on commit ffa2e29

Please sign in to comment.