Skip to content

Commit 5ec94a8

Browse files
author
Mohammed Ehab
committed
Merge remote-tracking branch 'remotes/origin/maxday/fix-flaky-test' into moehabe/supportjsonpayloads
2 parents f9b3690 + 0293d08 commit 5ec94a8

2 files changed

Lines changed: 14 additions & 8 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) {

lambda/sigterm_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func TestEnableSigterm(t *testing.T) {
8989

9090
time.Sleep(5 * time.Second) // Wait for container to start
9191

92-
client := &http.Client{Timeout: 5 * time.Second}
92+
client := &http.Client{Timeout: 10 * time.Second}
9393
invokeURL := fmt.Sprintf("http://127.0.0.1:%d/2015-03-31/functions/function/invocations", port)
9494
resp, err := client.Post(invokeURL, "application/json", strings.NewReader("{}"))
9595
require.NoError(t, err)

0 commit comments

Comments
 (0)