Skip to content

Commit

Permalink
test: fix failpoint
Browse files Browse the repository at this point in the history
Signed-off-by: <919179287@qq.com>
  • Loading branch information
gerayking committed Aug 30, 2023
1 parent 5e7220c commit bb50606
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cluster_endtoend_mysqltester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
DOCKER_BUILDKIT=0 docker build docker/wesqlscale/local/ -t apecloud/mysql-tester
# failpoint
chmod 755 ./test/failpoint/failpoints.sh && ./test/failpoint/failpoints.sh
chmod 755 ./test/failpoint/failpoints.sh && source ./test/failpoint/failpoints.sh
echo "GO_FAILPOINTS=$GO_FAILPOINTS" >> $GITHUB_OUTPUT
# run container
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/unit_test_mysql57.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,12 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true'
timeout-minutes: 30
run: |
# failpoint
chmod 755 ./test/failpoint/failpoints.sh && source ./test/failpoint/failpoints.sh
echo "GO_FAILPOINTS=$GO_FAILPOINTS" >> $GITHUB_OUTPUT
make failpoint-enable
eatmydata -- make unit_test | tee -a output.txt | go-junit-report -set-exit-code > report.xml
make failpoint-disable
- name: Print test output and Record test result
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' && always()
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/failpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func GetValueOfFailPoint(fpName string) failpoint.Value {
}

func TestFailpointEnable(t *testing.T) {
failpoint.Enable("vitess.io/vitess/go/vt/vtgate/testPanic", "return(1)")
//failpoint.Enable("vitess.io/vitess/go/vt/vtgate/testPanic", "return(1)")
fmt.Println("testPanic", GetValueOfFailPoint("testPanic"))
assert.Equal(t, 0, GetValueOfFailPoint("testPanic"))
}
1 change: 1 addition & 0 deletions test/failpoint/failpoints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
failpoints=(
"vitess.io/vitess/go/vt/vtgate/showTablets=return(2)"
"vitess.io/vitess/go/vt/vtgate/engine/InsertFailPoint=return(1)"
"vitess.io/vitess/go/vt/vtgate/testPanic=return(1)"
)

# Create an empty string
Expand Down

0 comments on commit bb50606

Please sign in to comment.