-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-27343: Fix flaky tests: TestHiveMetaStoreTimeout#testResetTimeout #4328
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
Conversation
|
|
||
| // no timeout before reset | ||
| client.dropDatabase(dbName, true, true); | ||
| HMSHandler.testTimeoutValue = 250; |
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.
I don't get it how this config will resolve the issue. Could you please elaborate it?
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.
Originally the low timeout value was set at the beginning of the test. Normally it is high enough that client.dropDatabase(dbName, true, true); won't timeout, but client.createDatabase(db); will do. However, if the network/DB is very slow, even client.dropDatabase(dbName, true, true); can timeout causing the whole test to fail. Since the default value of the timeout is -1 (no timout) I moved the lowering the value after the dropdatabase call, and restored -1 after createDatabase fail, so now the test is no longer sensitive to the environment.
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.
The setup method of the test enables timeout. What about playing with the timeout values, just disabling timeout at the beginning of the test case and re-enable it after the drop database command?
And also, I wonder why the test testNoTimeout is not flaky. It works with the same timeout value.
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.
Good idea, I'll rewrite the test methods that way
|
LGTM. Init timeout failed at precommits so please restart the tests. Anyway, the test cases were all green so it seem we are good. |
|
Kudos, SonarCloud Quality Gate passed! |








What changes were proposed in this pull request?
Fix the flaky test:
TestHiveMetaStoreTimeout#testResetTimeout
Why are the changes needed?
This test was sensitive to network/DB speed, and slow CI builds were resulted in unexpected timeouts.
Does this PR introduce any user-facing change?
No
How was this patch tested?
By running TestHiveMetaStoreTimeout#testResetTimeout manually