-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ttl: make some integration test faster #56719
Conversation
Hi @lcwangchao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@@ -416,6 +394,10 @@ func TestTTLJobDisable(t *testing.T) { | |||
store, dom := testkit.CreateMockStoreAndDomain(t) | |||
tk := testkit.NewTestKit(t, store) | |||
|
|||
// turn off the `tidb_ttl_job_enable` | |||
tk.MustExec("set global tidb_ttl_job_enable = 'OFF'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set the tidb_ttl_job_enable
to OFF
before creating TTL table to make test stable
for retryTime >= 0 { | ||
retryTime-- | ||
time.Sleep(retryInterval) | ||
time.Sleep(time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just sleep 1s to make the test faster. And boostJobScheduleForTest
can boost the test
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56719 +/- ##
=================================================
- Coverage 73.3334% 56.6010% -16.7325%
=================================================
Files 1630 1755 +125
Lines 450148 633259 +183111
=================================================
+ Hits 330109 358431 +28322
- Misses 99772 250841 +151069
- Partials 20267 23987 +3720
Flags with carried forward coverage won't be shown. Click here to find out more.
|
}() | ||
require.NoError(t, m.SubmitJob(se, tblID, tblID, "request1")) | ||
|
||
// notification is sent | ||
wg.Wait() | ||
|
||
for time.Now().Before(now.Add(time.Second * 5)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this case used for? It does not have any assertions. @YangKeao
a77e014
to
2944c3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tiancaiamao, YangKeao The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/retest |
@lcwangchao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What problem does this PR solve?
Issue Number: close #56718
What changed and how does it work?
boostJobScheduleForTest
to make some intervals smaller to boost test.In master, run tests in
pkg/ttl/ttlworker
takes 34.5s:In this PR, it takes 3.4s:
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.