-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Wait for rules to be refreshed in BaseCaseInsensitiveMappingTest #11506
Conversation
// wait to ensure rules have been refreshed | ||
Thread.sleep(2 * ruleRefreshPeriod.toMillis()); |
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.
2*
isn't necessary, is 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.
To be safe. should be refreshPeriod + some delta
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.
Kept 2x, moved sleep to the Utils class.
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.
should be refreshPeriod + some delta
i don't believe it should
To be safe.
fine, keep it.
plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseCaseInsensitiveMappingTest.java
Outdated
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseCaseInsensitiveMappingTest.java
Outdated
Show resolved
Hide resolved
@@ -307,7 +312,7 @@ public void testTableNameClashWithRuleMapping() | |||
public void testSchemaAndTableNameRuleMapping() | |||
throws Exception | |||
{ | |||
updateRuleBasedIdentifierMappingFile( | |||
updateRuleBasedIdentifierMappingFileAndWait( |
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.
Even if you introduce a new method, it could be called updateRuleBasedIdentifierMappingFile
(without "AndWait")
- smaller diff
- it makes it much harder to invoke the old method directly, since it's shadowed
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.
Moved sleep to existing method. Thanks.
b33f6b6
to
e6b2bba
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.
% comment. Thanks!
plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/BaseCaseInsensitiveMappingTest.java
Outdated
Show resolved
Hide resolved
e6b2bba
to
68c1b8d
Compare
A refresh period of 1ms doesn't guarantee that rules will be refreshed before they are used. Since the rules are refreshed synchronously we sleep for 2*refresh period to guarantee that rules are refreshed.
68c1b8d
to
8d818e7
Compare
A refresh period of 1ms doesn't guarantee that rules will be refreshed
before they are used. Since the rules are refreshed synchronously we
sleep for 2*refresh period to guarantee that rules are refreshed.
Documentation
(x) No documentation is needed.
Release notes
(x) No release notes entries required.