-
Notifications
You must be signed in to change notification settings - Fork 448
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
(trivial) removes some hardcoded fate values #5243
(trivial) removes some hardcoded fate values #5243
Conversation
Removes some hardcoded values used by Fate and Fate tests.
@@ -238,7 +238,7 @@ protected void testTransactionStatus(FateStore<TestEnv> store, ServerContext sct | |||
try { | |||
|
|||
// Wait for the transaction runner to be scheduled. | |||
Thread.sleep(3000); | |||
Thread.sleep(fate.getInitialDelay().toMillis() * 2); |
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.
greater than the delay to avoid potential timing issues
@@ -476,10 +477,18 @@ public Fate(T environment, FateStore<T> store, boolean runDeadResCleaner, | |||
this.workFinder.start(); | |||
} | |||
|
|||
public Duration getInitialDelay() { |
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.
Is the plan to allow overriding these methods? If not maybe they could be public and statically defined constants in Fate? Even if we want to keep the methods to allow overriding they could delegate to the statically defined constants (if you keep the methods they could be private). This way we are not creating new objects each time the method is called.
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.
Thanks for the suggestions. We shouldn't allow overriding for initial delay, so I removed that. getDeadResCleanupDelay
is already overridden in FastFate
and I also plan to override getPoolWatcherDelay
in FastFate
as well in an upcoming PR, so left those methods but no longer create a new Duration each time.
Removes some hardcoded values used by Fate and Fate tests.