Skip to content

Commit

Permalink
adapt endtoend tests
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Nov 23, 2020
1 parent c4f217e commit dff9fb3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions go/test/endtoend/onlineddl/onlineddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ var (
ALTER TABLE %s
DROP PRIMARY KEY,
DROP COLUMN ghost_col`
// We will run this query with "gh-ost --max-load=Threads_running=1"
alterTableThrottlingStatement = `
ALTER WITH 'gh-ost' '--max-load=Threads_running=1' TABLE %s
ALTER TABLE %s
DROP COLUMN ghost_col`
)

Expand Down Expand Up @@ -164,20 +165,20 @@ func TestSchemaChange(t *testing.T) {
checkRetryMigration(t, uuid, false)
}
{
uuid := testAlterTable(t, alterTableTrivialStatement, string(schema.DDLStrategyGhost), "vtctl", "ghost_col")
uuid := testAlterTable(t, alterTableTrivialStatement, "gh-ost", "vtctl", "ghost_col")
checkRecentMigrations(t, uuid, schema.OnlineDDLStatusComplete)
checkCancelMigration(t, uuid, false)
checkRetryMigration(t, uuid, false)
}
{
uuid := testAlterTable(t, alterTableThrottlingStatement, string(schema.DDLStrategyGhost), "vtgate", "ghost_col")
uuid := testAlterTable(t, alterTableThrottlingStatement, "gh-ost --max-load=Threads_running=1", "vtgate", "ghost_col")
checkRecentMigrations(t, uuid, schema.OnlineDDLStatusRunning)
checkCancelMigration(t, uuid, true)
time.Sleep(2 * time.Second)
checkRecentMigrations(t, uuid, schema.OnlineDDLStatusFailed)
}
{
uuid := testAlterTable(t, alterTableFailedStatement, string(schema.DDLStrategyGhost), "vtgate", "ghost_col")
uuid := testAlterTable(t, alterTableFailedStatement, "gh-ost", "vtgate", "ghost_col")
checkRecentMigrations(t, uuid, schema.OnlineDDLStatusFailed)
checkCancelMigration(t, uuid, false)
checkRetryMigration(t, uuid, true)
Expand Down

0 comments on commit dff9fb3

Please sign in to comment.