@@ -90,7 +90,8 @@ private fun cleanBlockHoundTraces(frames: List<String>): List<String> {
90
90
public fun verifyDump (vararg traces : String , ignoredCoroutine : String? = null) {
91
91
val baos = ByteArrayOutputStream ()
92
92
DebugProbes .dumpCoroutines(PrintStream (baos))
93
- val trace = baos.toString().split(" \n\n " )
93
+ val wholeDump = baos.toString()
94
+ val trace = wholeDump.split(" \n\n " )
94
95
if (traces.isEmpty()) {
95
96
val filtered = trace.filter { ignoredCoroutine == null || ! it.contains(ignoredCoroutine) }
96
97
assertEquals(1 , filtered.count())
@@ -105,15 +106,15 @@ public fun verifyDump(vararg traces: String, ignoredCoroutine: String? = null) {
105
106
106
107
val expected = traces[index - 1 ].applyBackspace().split(" \n\t (Coroutine creation stacktrace)\n " , limit = 2 )
107
108
val actual = value.applyBackspace().split(" \n\t (Coroutine creation stacktrace)\n " , limit = 2 )
108
- assertEquals(expected.size, actual.size, " Creation stacktrace should be part of the expected input" )
109
+ assertEquals(expected.size, actual.size, " Creation stacktrace should be part of the expected input. Whole dump: \n $wholeDump " )
109
110
110
111
expected.withIndex().forEach { (index, trace) ->
111
112
val actualTrace = actual[index].trimStackTrace().sanitizeAddresses()
112
113
val expectedTrace = trace.trimStackTrace().sanitizeAddresses()
113
114
val actualLines = cleanBlockHoundTraces(actualTrace.split(" \n " ))
114
115
val expectedLines = expectedTrace.split(" \n " )
115
116
for (i in expectedLines.indices) {
116
- assertEquals(expectedLines[i], actualLines[i])
117
+ assertEquals(expectedLines[i], actualLines[i], " Whole dump: \n $wholeDump " )
117
118
}
118
119
}
119
120
}
0 commit comments