This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.7 by this push:
new 85a3e82ad [KYUUBI #3920][TEST] Fix flaky test - distribute lock
85a3e82ad is described below
commit 85a3e82adbdd1609051edafb8993e3ab58798309
Author: Cheng Pan <[email protected]>
AuthorDate: Tue Aug 1 11:34:33 2023 +0800
[KYUUBI #3920][TEST] Fix flaky test - distribute lock
### _Why are the changes needed?_
Fix #3920
https://github.com/apache/kyuubi/actions/runs/5711863703/job/15474230690?pr=4790
```
DockerizedZkServiceDiscoverySuite:
- distribute lock *** FAILED ***
Expected exception org.apache.kyuubi.KyuubiSQLException to be thrown, but
no exception was thrown (DiscoveryClientTests.scala:147)
```
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including
negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
locally before make a pull request
Closes #5112 from pan3793/test-lock.
Closes #3920
d980f87dc [Cheng Pan] Fix flaky test - distribute lock
Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit 0bd59e5bbaccfc203d5ef38b541cad309881e554)
Signed-off-by: Cheng Pan <[email protected]>
---
.../scala/org/apache/kyuubi/ha/client/DiscoveryClientTests.scala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/DiscoveryClientTests.scala
b/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/DiscoveryClientTests.scala
index 87db340b5..61f98bf42 100644
---
a/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/DiscoveryClientTests.scala
+++
b/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/DiscoveryClientTests.scala
@@ -135,17 +135,17 @@ trait DiscoveryClientTests extends KyuubiFunSuite {
new Thread(() => {
withDiscoveryClient(conf) { discoveryClient =>
- discoveryClient.tryWithLock(lockPath, 3000) {
+ discoveryClient.tryWithLock(lockPath, 10000) {
lockLatch.countDown()
- Thread.sleep(5000)
+ Thread.sleep(15000)
}
}
}).start()
withDiscoveryClient(conf) { discoveryClient =>
- assert(lockLatch.await(5000, TimeUnit.MILLISECONDS))
+ assert(lockLatch.await(20000, TimeUnit.MILLISECONDS))
val e = intercept[KyuubiSQLException] {
- discoveryClient.tryWithLock(lockPath, 2000) {}
+ discoveryClient.tryWithLock(lockPath, 5000) {}
}
assert(e.getMessage contains s"Timeout to lock on path [$lockPath]")
}