Skip to content

Commit

Permalink
More nits
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Jan 23, 2025
1 parent a7f400c commit 3964c7c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions go/test/endtoend/vreplication/vreplication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ func shardCustomer(t *testing.T, testReverse bool, cells []*Cell, sourceCellOrAl
numTestRows := 100
addTestRows := func() {
for i := 0; i < numTestRows; i++ {
execQuery(t, productConn, fmt.Sprintf("insert into customer (cid, name) values (%d, 'laggingCustomer')", startingTestRowID+i))
execQuery(t, productConn, fmt.Sprintf("insert into customer (cid, name) values (%d, 'laggingCustomer')",
startingTestRowID+i))
}
}
deleteTestRows := func() {
Expand Down Expand Up @@ -885,9 +886,9 @@ func shardCustomer(t *testing.T, testReverse bool, cells []*Cell, sourceCellOrAl
waitForNoWorkflowLag(t, vc, targetKs, workflow)
}

// First let's test that the pre-checks work as expected.
// We ALTER the table on the customer (target) shard to
// add a unique index on the name field.
// First let's test that the pre-checks work as expected. We ALTER
// the table on the customer (target) shard to add a unique index on
// the name field.
addIndex()
// Then we insert some test rows across both shards in the product
// (source) keyspace.
Expand All @@ -907,11 +908,12 @@ func shardCustomer(t *testing.T, testReverse bool, cells []*Cell, sourceCellOrAl
waitForTargetToCatchup()

// Now let's test that the cancel works by setting the command timeout
// to half the duration. Lock the customer table on the target tablets
// so that we cannot apply the INSERTs and catch up.
// to a fraction (6s) of the default max repl lag duration (30s). First
// we lock the customer table on the target tablets so that we cannot
// apply the INSERTs and catch up.
lockTargetTable()
addTestRows()
timeout := lagDuration * 2
timeout := lagDuration * 2 // 6s
// Use the default max-replication-lag-allowed value of 30s.
out, err = vc.VtctldClient.ExecuteCommandWithOutput(workflowType, "--workflow", workflow, "--target-keyspace", targetKs,
"SwitchTraffic", "--tablet-types=primary", "--timeout", timeout.String())
Expand Down

0 comments on commit 3964c7c

Please sign in to comment.