Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session: make TestUpgradeVersionForResumeJob faster #50299

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/session/bootstraptest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
name = "bootstraptest_test",
timeout = "moderate",
timeout = "short",
srcs = [
"bootstrap_upgrade_test.go", #keep
"main_test.go",
Expand Down
18 changes: 0 additions & 18 deletions pkg/session/bootstraptest/bootstrap_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,24 +554,6 @@ func TestUpgradeVersionForResumeJob(t *testing.T) {
ch := make(chan struct{})
hook := &callback.TestDDLCallback{}
var jobID int64
doOnce := true
hook.OnGetJobBeforeExported = func(str string) {
if jobID == 0 || !doOnce {
return
}

for i := 0; i < 50; i++ {
sql := fmt.Sprintf("admin show ddl jobs where job_id=%d or job_id=%d", jobID, jobID+1)
se := session.CreateSessionAndSetID(t, store)
rows, err := execute(context.Background(), se, sql)
require.NoError(t, err)
if len(rows) == 2 {
doOnce = false
break
}
time.Sleep(100 * time.Millisecond)
}
}
wg := sync.WaitGroup{}
wg.Add(1)
times := 0
Expand Down