-
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
util/encrypt: migrate test-infra to testify #28016
util/encrypt: migrate test-infra to testify #28016
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc @tisonkun |
Question: Do we need the extra options for the goleak? To ignore some top level functions. But I didn't get any leak error while running { make failpoint-enable; go test github.com/pingcap/tidb/util/encrypt; make failpoint-disable; } So I'm guessing there's nothing to ignore in this case, unlike here https://github.com/pingcap/tidb/blob/master/ddl/failtest/main_test.go#L37-L42 |
By the way, I noticed some unrelated errors while running all the tests - tidb $ make gotest
Running in native mode.
gsttimeout-check
grep 'PASS:' gotest.log | go run tools/check/check-timeout.go || { $(find $PWD/ -type d | grep -vE "(\.git|tools)" | xargs tools/bin/failpoint-ctl disable); exit 1; }
^R
The following test cases take too long to finish:
PASS: builtin_time_vec_generated_test.go:6727: testVectorizeSuite1.TestVectorizedBuiltinTimeEvalOneVecGenerated 6.754s
PASS: builtin_time_vec_test.go:575: testVectorizeSuite2.TestVectorizedBuiltinTimeEvalOneVec 7.341s
PASS: builtin_time_vec_test.go:579: testVectorizeSuite2.TestVectorizedBuiltinTimeFunc 5.569s
--- PASS: TestClusterConfigInfoschema (5.71s)
--- PASS: TestCTEPreviewAndReport (7.12s)
exit status 252
make: *** [gotest] Error 1
tidb $ |
There seems to be an unrelated error in pipeline too over here https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_check_2/detail/tidb_ghpr_check_2/33109/pipeline [2021-09-13T15:40:22.324Z] FAIL
[2021-09-13T15:40:22.324Z] + cat test.log
[2021-09-13T15:40:22.324Z] + grep -Ev '^\[[[:digit:]]{4}(/[[:digit:]]{2}){2}'
[2021-09-13T15:40:22.324Z] + grep -A 30 '\-------'
[2021-09-13T15:40:22.324Z] + grep -A 29 FAIL
[2021-09-13T15:40:22.324Z] FAIL: attributes_sql_test.go:237: testDBSuite8.TestFlashbackTable
[2021-09-13T15:40:22.324Z]
[2021-09-13T15:40:22.324Z] attributes_sql_test.go:301:
[2021-09-13T15:40:22.324Z] c.Assert(rows2[0][3], Equals, rows[0][3])
[2021-09-13T15:40:22.324Z] ... obtained string = "7480000000000021ff4e5f720000000000fa"
[2021-09-13T15:40:22.324Z] ... expected string = "7480000000000000ff375f720000000000fa" |
Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
…7816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
…27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
pingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
…ingcap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
…27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
…ap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
…ap#27816) Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
…k suite and golang test Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
Signed-off-by: Karuppiah Natarajan <karuppiah7890@users.noreply.github.com>
54bcb8d
to
5551888
Compare
Oops. Sorry, I just did rebase and force pushed and noticed that there was a merge being done |
Hi @karuppiah7890 ! Thanks for your contribution and sorry for our unstable tests in such a terrible situation. For any failing tests you found, you can try to find an issue on #25899:
Thanks for your understanding. |
For some test cases, goroutine leaks are known issues, we should add these goroutines to ignore list, such as tidb/ddl/failtest/main_test.go Lines 37 to 40 in 9d3b67f
But some goroutine leaks are caused by test code, we should try to fix them. |
Never mind. If my action causes any inconvenient, please let me know. In our dev guide it says:
Since the catching up so frequently I move to use the merge button gradually. |
Makes sense 👍 |
@unconsolable how do I know if my test has any known goroutine leaks and that I need to ignore them? Similar to https://github.com/pingcap/tidb/blob/master/ddl/failtest/main_test.go#L37-L42 How was it found that https://github.com/pingcap/tidb/blob/master/ddl/failtest/main_test.go#L37-L42 has known goroutine leaks - does it always show as leak error or only sometimes? |
I usually add tidb/util/testleak/leaktest.go Lines 55 to 69 in 9d3b67f
However, there is a exception. #27704 (comment) Solution tidb/store/mockstore/mockcopr/main_test.go Lines 32 to 37 in 9d3b67f
|
Cool ! So, when I ran in my local, I noticed no issues / errors related to goroutine leaks, let me also check the exception now |
Looks like after rebase there are no unstable errors in my local and in CI, interesting |
@karuppiah7890 the most unstable timeout checker is temporarily disabled by #27980 |
Ah okay! |
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
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 5551888
|
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.
@karuppiah7890 I think almost these test cases can be run in parallel.
I think it is ok to leave as is since it is almost lightweight test. But if you can investigate the possibility for running in parallel, I'm glad to give it a review and moderate the contribution. You can create an issue for the follow up and then a PR, if you'd like to do it. |
Yes, the tests are lightweight indeed, all running within less than 1 second. But yes, parallelization would be cool. I will raise an issue and a PR for it sometime 👍 |
Created the issue for now - #28034 |
What problem does this PR solve?
Issue Number: close #27816
Problem Summary: migrate test-infra to testify for
util/encrypt
packageWhat is changed and how it works?
What's Changed:
Migrated tests to use testify package instead of
github.com/pingcap/check package
for assertions and any test utils and matchers thatgithub.com/pingcap/check
providedCheck List
Tests
Release note