Skip to content
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

[KYUUBI #5600] Fix flaky test SessionsResourceSuite #5675

Closed
wants to merge 7 commits into from
Closed
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ class SessionsResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {

val statistic = webTarget.path("api/v1/sessions/execPool/statistic").request().get()
val execPoolStatistic1 = statistic.readEntity(classOf[ExecPoolStatistic])
// because this operation is asynchronous,
// there is no guarantee that it will complete quickly or fail in the process
// so we can not guarantee the poolActiveThread count must equal to 1
assert(execPoolStatistic1.getExecPoolSize == 1 &&
execPoolStatistic1.getExecPoolActiveCount == 1)
davidyuan1223 marked this conversation as resolved.
Show resolved Hide resolved
(execPoolStatistic1.getExecPoolActiveCount == 1 ||
execPoolStatistic1.getExecPoolActiveCount == 0))

response = webTarget.path("api/v1/sessions/count").request().get()
val openedSessionCount = response.readEntity(classOf[SessionOpenCount])
Expand Down Expand Up @@ -97,11 +101,15 @@ class SessionsResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {
response = webTarget.path(s"api/v1/sessions/$sessionHandle").request().delete()
assert(200 == response.getStatus)

// because delete is a asynchronous operation, we need sleep to
// make sure the delete operation process complete
Thread.sleep(3000)
davidyuan1223 marked this conversation as resolved.
Show resolved Hide resolved
// get session list again
response2 = webTarget.path("api/v1/sessions").request().get()
assert(200 == response2.getStatus)
val sessions2 = response2.readEntity(classOf[Seq[SessionData]])
assert(sessions2.isEmpty)

val sessions = response2.readEntity(classOf[Seq[SessionData]])
assert(sessions.isEmpty)
}

test("get session event") {
Expand Down
Loading