pan3793 commented on code in PR #7249:
URL: https://github.com/apache/kyuubi/pull/7249#discussion_r2544553712
##########
kyuubi-common/src/test/scala/org/apache/kyuubi/operation/HiveJDBCTestHelper.scala:
##########
@@ -124,11 +124,27 @@ trait HiveJDBCTestHelper extends JDBCTestHelper {
}
def waitForOperationToComplete(client: Iface, op: TOperationHandle): Unit = {
- val req = new TGetOperationStatusReq(op)
- var state = client.GetOperationStatus(req).getOperationState
- eventually(timeout(90.seconds), interval(100.milliseconds)) {
- state = client.GetOperationStatus(req).getOperationState
- assert(!Set(INITIALIZED_STATE, PENDING_STATE,
RUNNING_STATE).contains(state))
+ assertOperationStatusIn(
+ client,
+ op,
+ Set(
+ FINISHED_STATE,
+ CANCELED_STATE,
+ CLOSED_STATE,
+ ERROR_STATE,
+ UKNOWN_STATE,
+ TIMEDOUT_STATE),
+ 90)
+ }
+
+ def assertOperationStatusIn(
+ client: Iface,
+ op: TOperationHandle,
+ status: Set[TOperationState],
+ timeoutInSeconds: Int): Unit = {
Review Comment:
it's actually `waitForOperationStatusIn`, and normally, we use millis for
duration in most cases, so `timeoutInSeconds` => `timeoutMs`, and on the caller
side, you can use named args `timeoutMs = 90000` to eliminate ambiguity
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]