@@ -130,14 +130,20 @@ func TestRuntimeAPILoopWithConcurrencyPanic(t *testing.T) {
130130 assert .Equal (t , concurrency , record .nGets )
131131 assert .Equal (t , concurrency , record .nPosts )
132132 assert .Equal (t , int32 (concurrency ), counter .Load ())
133- assert .Contains (t , string (record .responses [0 ]), "panic 1" )
133+
134+ // Verify all three panics are in the responses (order may vary due to concurrency)
135+ allResponses := ""
136+ for _ , resp := range record .responses {
137+ allResponses += string (resp )
138+ }
139+ assert .Contains (t , allResponses , "panic 1" )
140+ assert .Contains (t , allResponses , "panic 2" )
141+ assert .Contains (t , allResponses , "panic 3" )
142+
134143 logs := logBuf .String ()
135- idx1 := strings .Index (logs , "panic 1" )
136- idx2 := strings .Index (logs , "panic 2" )
137- idx3 := strings .Index (logs , "panic 3" )
138- assert .Greater (t , idx1 , - 1 )
139- assert .Greater (t , idx2 , idx1 )
140- assert .Greater (t , idx3 , idx2 )
144+ assert .Contains (t , logs , "panic 1" )
145+ assert .Contains (t , logs , "panic 2" )
146+ assert .Contains (t , logs , "panic 3" )
141147}
142148
143149func TestConcurrencyWithRIE (t * testing.T ) {
0 commit comments