Skip to content

Commit 9fb6a46

Browse files
committed
test(backend/redis): diagnostic index on expire
1 parent e9711ad commit 9fb6a46

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

backend/redis/expire_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/cschleiden/go-workflows/worker"
1111
"github.com/cschleiden/go-workflows/workflow"
1212
"github.com/google/uuid"
13+
"github.com/stretchr/testify/assert"
1314
"github.com/stretchr/testify/require"
1415
)
1516

@@ -50,6 +51,10 @@ func Test_AutoExpiration(t *testing.T) {
5051
_, err = b.GetWorkflowInstanceState(ctx, wfi)
5152
require.ErrorIs(t, err, backend.ErrInstanceNotFound)
5253

54+
insts, err := b.GetWorkflowInstances(ctx, "", "", 1)
55+
require.NoError(t, err)
56+
assert.Len(t, insts, 0)
57+
5358
cancel()
5459
require.NoError(t, w.WaitForCompletion())
5560
}

backend/test/backend.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import (
55

66
"github.com/cschleiden/go-workflows/backend"
77
"github.com/cschleiden/go-workflows/backend/history"
8+
"github.com/cschleiden/go-workflows/diag"
89
)
910

1011
type TestBackend interface {
1112
backend.Backend
13+
diag.Backend
1214

1315
GetFutureEvents(ctx context.Context) ([]*history.Event, error)
1416
}

0 commit comments

Comments
 (0)