Skip to content

Commit c3bbe75

Browse files
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent c74c1c8 commit c3bbe75

5 files changed

Lines changed: 8 additions & 10 deletions

File tree

go/base/context.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,18 +1169,16 @@ func WithFailPointWait(wait time.Duration) FailPointOpt {
11691169

11701170
func (mctx *MigrationContext) NewFailPoint(name string, opts ...FailPointOpt) {
11711171
if mctx.UnsafeFailPointsEnabled {
1172-
mctx.Log.Debugf("[TEST] Injecting fail point: '%s'", name)
1173-
11741172
var fpo failPointOpts
11751173
for _, opt := range opts {
11761174
opt(&fpo)
11771175
}
11781176

11791177
failpoint.Inject(name, func(_ failpoint.Value) {
1178+
mctx.Log.Debugf("[TEST] Encountered fail point: '%s'", name)
11801179
if fpo.wait > 0 {
1181-
<-time.After(fpo.wait)
1180+
time.Sleep(fpo.wait)
11821181
}
1183-
11841182
panic(fmt.Sprintf("[TEST] Encountered fail point: '%s'", name))
11851183
})
11861184
}

localtests/move-tables-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ build_ghost_command() {
210210
--execute ${extra_args[@]}"
211211

212212
if [ -n "$GO_FAILPOINTS" ]; then
213-
cmd="GO_FAILPOINTS=\"$GO_FAILPOINTS\" $cmd --unsafe-fail-points-enabled"
213+
cmd="GO_FAILPOINTS=\"$GO_FAILPOINTS\" $cmd"
214214
fi
215215
}
216216

localtests/move-tables/resume-panic-before-drain-complete/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if [ $? -gt 0 ]; then
6161
fi
6262

6363
# Table not writeable on source
64-
mysql-exec target source $database -sNe "INSERT INTO ${table_name} VALUES (NULL, 1021, 2001, 2400001, 201, 1700000041, 1700000041);"
64+
mysql-exec source primary $database -sNe "INSERT INTO ${table_name} VALUES (NULL, 1021, 2001, 2400001, 201, 1700000041, 1700000041);"
6565
if [ $? -eq 0 ]; then
6666
echo "ERROR: Table '${table_name}' was writeable on source but should not be!."
6767
return 1
@@ -98,7 +98,7 @@ cmd="$cmd --resume"
9898
bash -c "$cmd" >>$test_logfile 2>&1
9999
ghost_result=$?
100100

101-
if [ $ghost_result -neq 0 ]; then
101+
if [ $ghost_result -ne 0 ]; then
102102
echo "ERROR: gh-ost should have succeeded but did not. ($ghost_result)"
103103
return 1
104104
fi

localtests/move-tables/resume-panic-before-on-success-hook/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if [ $? -gt 0 ]; then
7070
fi
7171

7272
# Table not writeable on source
73-
mysql-exec target source $database -sNe "INSERT INTO ${table_name} VALUES (NULL, 1021, 2001, 2400001, 201, 1700000041, 1700000041);"
73+
mysql-exec source primary $database -sNe "INSERT INTO ${table_name} VALUES (NULL, 1021, 2001, 2400001, 201, 1700000041, 1700000041);"
7474
if [ $? -eq 0 ]; then
7575
echo "ERROR: Table '${table_name}' was writeable on source but should not be!."
7676
return 1
@@ -121,7 +121,7 @@ cmd="$cmd --resume"
121121
bash -c "$cmd" >>$test_logfile 2>&1
122122
ghost_result=$?
123123

124-
if [ $ghost_result -neq 0 ]; then
124+
if [ $ghost_result -ne 0 ]; then
125125
echo "ERROR: gh-ost should have succeeded but did not. ($ghost_result)"
126126
return 1
127127
fi

localtests/move-tables/resume-panic-on-row-copy/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ cmd="$cmd --resume"
8484
bash -c "$cmd" >>$test_logfile 2>&1
8585
ghost_result=$?
8686

87-
if [ $ghost_result -neq 0 ]; then
87+
if [ $ghost_result -ne 0 ]; then
8888
echo "ERROR: gh-ost should have succeeded but did not. ($ghost_result)"
8989
return 1
9090
fi

0 commit comments

Comments
 (0)