Skip to content

Commit b39b581

Browse files
committed
Fix deadlock when executing test without cache
1 parent 118460a commit b39b581

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/test/e2e.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ func EndToEndBackendTest(t *testing.T, setup func() TestBackend, teardown func(b
166166
return i * 2, nil
167167
}
168168

169-
ch := make(chan struct{}, 1)
169+
// Workflow will be executed multiple times, but the test will wait only once. Create buffered channel
170+
ch := make(chan struct{}, 10)
170171

171172
wf := func(ctx workflow.Context) (int, error) {
172173
swfs := make([]workflow.Future[int], 0)
@@ -177,6 +178,7 @@ func EndToEndBackendTest(t *testing.T, setup func() TestBackend, teardown func(b
177178
// Unblock test. Should not do this in production code, but here we know that this will be executed in the same process.
178179
ch <- struct{}{}
179180

181+
// Wait for subworkflows to complete
180182
r := 0
181183

182184
for _, f := range swfs {

0 commit comments

Comments
 (0)