7
7
package test
8
8
9
9
import (
10
- "context"
11
10
"database/sql"
12
11
"testing"
13
12
@@ -42,7 +41,7 @@ func TestWorkflowNormal(t *testing.T) {
42
41
return nil
43
42
})
44
43
45
- err := workflow .Execute (context . Background (), gid , gid , dtmimp .MustMarshal (req ))
44
+ err := workflow .Execute (gid , gid , dtmimp .MustMarshal (req ))
46
45
assert .Nil (t , err )
47
46
assert .Equal (t , StatusSucceed , getTransStatus (gid ))
48
47
}
@@ -83,7 +82,7 @@ func TestWorkflowRollback(t *testing.T) {
83
82
})
84
83
before := getBeforeBalances ("mysql" )
85
84
86
- err := workflow .Execute (context . Background (), gid , gid , dtmimp .MustMarshal (req ))
85
+ err := workflow .Execute (gid , gid , dtmimp .MustMarshal (req ))
87
86
assert .Error (t , err , dtmcli .ErrFailure )
88
87
assert .Equal (t , StatusFailed , getTransStatus (gid ))
89
88
assertSameBalance (t , before , "mysql" )
@@ -121,7 +120,7 @@ func TestWorkflowTcc(t *testing.T) {
121
120
})
122
121
123
122
before := getBeforeBalances ("mysql" )
124
- err := workflow .Execute (context . Background (), gid , gid , dtmimp .MustMarshal (req ))
123
+ err := workflow .Execute (gid , gid , dtmimp .MustMarshal (req ))
125
124
assert .Nil (t , err )
126
125
assert .Equal (t , StatusSucceed , getTransStatus (gid ))
127
126
assertNotSameBalance (t , before , "mysql" )
@@ -159,7 +158,7 @@ func TestWorkflowTccRollback(t *testing.T) {
159
158
})
160
159
161
160
before := getBeforeBalances ("mysql" )
162
- err := workflow .Execute (context . Background (), gid , gid , dtmimp .MustMarshal (req ))
161
+ err := workflow .Execute (gid , gid , dtmimp .MustMarshal (req ))
163
162
assert .Error (t , err )
164
163
assert .Equal (t , StatusFailed , getTransStatus (gid ))
165
164
assertSameBalance (t , before , "mysql" )
@@ -178,7 +177,7 @@ func TestWorkflowError(t *testing.T) {
178
177
return err
179
178
})
180
179
181
- err := workflow .Execute (context . Background (), gid , gid , dtmimp .MustMarshal (req ))
180
+ err := workflow .Execute (gid , gid , dtmimp .MustMarshal (req ))
182
181
assert .Error (t , err )
183
182
cronTransOnceForwardCron (t , gid , 1000 )
184
183
assert .Equal (t , StatusSucceed , getTransStatus (gid ))
@@ -197,7 +196,7 @@ func TestWorkflowOngoing(t *testing.T) {
197
196
return err
198
197
})
199
198
200
- err := workflow .Execute (context . Background (), gid , gid , dtmimp .MustMarshal (req ))
199
+ err := workflow .Execute (gid , gid , dtmimp .MustMarshal (req ))
201
200
assert .Error (t , err )
202
201
cronTransOnceForwardCron (t , gid , 1000 )
203
202
assert .Equal (t , StatusSucceed , getTransStatus (gid ))
@@ -225,7 +224,7 @@ func TestWorkflowResumeSkip(t *testing.T) {
225
224
return err
226
225
})
227
226
228
- err := workflow .Execute (context . Background (), gid , gid , dtmimp .MustMarshal (req ))
227
+ err := workflow .Execute (gid , gid , dtmimp .MustMarshal (req ))
229
228
assert .Error (t , err )
230
229
cronTransOnceForwardCron (t , gid , 1000 )
231
230
assert .Equal (t , StatusSucceed , getTransStatus (gid ))
0 commit comments