Skip to content

Commit 0293d08

Browse files
committed
fix: TestRuntimeAPILoopWithConcurrencyPanic
1 parent 8a7ba80 commit 0293d08

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

lambda/invoke_loop_gte_go122_test.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

143149
func TestConcurrencyWithRIE(t *testing.T) {

0 commit comments

Comments
 (0)