Skip to content

Commit

Permalink
[FOLLOWUP apache#647] Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed May 27, 2021
1 parent 8ce6d01 commit 28cd6da
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.kyuubi.operation

import org.apache.hive.service.rpc.thrift.{TExecuteStatementReq, TGetOperationStatusReq, TOperationState, TStatusCode}
import org.scalatest.time.SpanSugar.convertIntToGrainOfTime

import org.apache.kyuubi.WithKyuubiServer
import org.apache.kyuubi.config.KyuubiConf
Expand All @@ -41,10 +42,12 @@ class KyuubiOperationPerConnectionSuite extends WithKyuubiServer with BasicJDBCT
executeStmtReq.setRunAsync(true)
val executeStmtResp = client.ExecuteStatement(executeStmtReq)

val getOpStatusReq = new TGetOperationStatusReq(executeStmtResp.getOperationHandle)
val getOpStatusResp = client.GetOperationStatus(getOpStatusReq)
assert(getOpStatusResp.getStatus.getStatusCode === TStatusCode.SUCCESS_STATUS)
assert(getOpStatusResp.getOperationState === TOperationState.ERROR_STATE)
eventually(timeout(10.seconds), interval(500.milliseconds)) {
val getOpStatusReq = new TGetOperationStatusReq(executeStmtResp.getOperationHandle)
val getOpStatusResp = client.GetOperationStatus(getOpStatusReq)
assert(getOpStatusResp.getStatus.getStatusCode === TStatusCode.SUCCESS_STATUS)
assert(getOpStatusResp.getOperationState === TOperationState.ERROR_STATE)
}
}
}
}

0 comments on commit 28cd6da

Please sign in to comment.