-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: support retry #239
feat: support retry #239
Conversation
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. Could you please update CHANGELOG and bump version in Cargo.toml? Then I will merge and release a new version
sqllogictest/src/runner.rs
Outdated
let result = self.run_async(record.clone()).await; | ||
if result.is_ok() { | ||
return result; | ||
} |
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.
Do we distinguish connection error and application error? I think it's not worth retrying if there's connection error.
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.
Considering that tests with retry
should only take a very small proportion, I don't think it's necessary.
sqllogictest/src/runner.rs
Outdated
@@ -875,6 +877,35 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> { | |||
} | |||
} | |||
|
|||
/// Run a single record with retry. | |||
pub async fn run_async_with_retry( |
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.
It seems confusing to introduce a new method specifically to make retry
work. For example, run_parallel_async
does not hit this path.
I suggest moving the retry logic into apply_record
instead, given that it's a per-record modifier.
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 feel that it's a bit confusing to do retry in sqllogictest --override
, so I did it outside of apply_record
.
For example, run_parallel_async does not hit this path.
How about rename run_async_with_retry
to run_async
to ensure all path are covered?
8eb4368
to
3529c2b
Compare
Signed-off-by: Eric Fu <fuyufjh@gmail.com>
3529c2b
to
f138b6c
Compare
Signed-off-by: Eric Fu <fuyufjh@gmail.com>
373f252
to
1458d31
Compare
published |
Resolves #238.
Also removed
label
fromQueryExpect::Results
because it's never used.