mirror of
https://github.com/enso-org/enso.git
synced 2024-11-30 05:35:09 +03:00
Thread dump on test timeout (#8785)
This commit is contained in:
parent
080690b3ad
commit
7d56cdc234
@ -115,7 +115,31 @@ abstract class JsonRpcServerTestKit
|
||||
def send(json: Json): Unit = send(json.noSpaces)
|
||||
|
||||
def expectMessage(timeout: FiniteDuration = 5.seconds.dilated): String = {
|
||||
val message = outActor.expectMsgClass[String](timeout, classOf[String])
|
||||
val message =
|
||||
try {
|
||||
outActor.expectMsgClass[String](timeout, classOf[String])
|
||||
} catch {
|
||||
case e: AssertionError if e.getMessage.contains("timeout") =>
|
||||
val sb = new StringBuilder(
|
||||
"Thread dump when timeout is reached while waiting for the message:\n"
|
||||
)
|
||||
Thread.getAllStackTraces.entrySet.forEach { entry =>
|
||||
sb.append(entry.getKey.getName).append("\n")
|
||||
entry.getValue.foreach { e =>
|
||||
sb.append(" ")
|
||||
.append(e.getClassName)
|
||||
.append(".")
|
||||
.append(e.getMethodName)
|
||||
.append("(")
|
||||
.append(e.getFileName)
|
||||
.append(":")
|
||||
.append(e.getLineNumber)
|
||||
.append(")\n")
|
||||
}
|
||||
}
|
||||
println(sb.toString())
|
||||
throw e
|
||||
}
|
||||
if (debugMessages) println(message)
|
||||
message
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user