File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ func Test_AutoExpiration_SubWorkflow(t *testing.T) {
71
71
ctx , cancel := context .WithCancel (context .Background ())
72
72
73
73
require .NoError (t , w .Start (ctx ))
74
+ defer func () {
75
+ cancel ()
76
+
77
+ require .NoError (t , w .WaitForCompletion ())
78
+ }()
74
79
75
80
swf := func (ctx workflow.Context ) (int , error ) {
76
81
return 42 , nil
@@ -101,12 +106,9 @@ func Test_AutoExpiration_SubWorkflow(t *testing.T) {
101
106
require .Equal (t , 42 , r )
102
107
103
108
// Wait for redis to expire the keys
104
- time .Sleep (autoExpirationTime )
109
+ time .Sleep (autoExpirationTime * 2 )
105
110
106
111
// Main workflow should now be expired
107
112
_ , err = b .GetWorkflowInstanceState (ctx , wfi )
108
113
require .ErrorIs (t , err , backend .ErrInstanceNotFound )
109
-
110
- cancel ()
111
- require .NoError (t , w .WaitForCompletion ())
112
114
}
You can’t perform that action at this time.
0 commit comments