Skip to content

Commit c9f132d

Browse files
committed
test: record start time before creating context
Signed-off-by: ghosind <ghosind@gmail.com>
1 parent 958829e commit c9f132d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

until_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ func TestUntilWithTestFunctionError(t *testing.T) {
9191

9292
func TestUntilWithContext(t *testing.T) {
9393
a := assert.New(t)
94+
start := time.Now()
9495
ctx, canFunc := context.WithTimeout(context.Background(), 100*time.Millisecond)
9596
defer canFunc()
9697

97-
start := time.Now()
9898
out, err := async.UntilWithContext(ctx, func(ctx context.Context) bool {
9999
select {
100100
case <-ctx.Done():

while_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func TestWhileWithFunctionError(t *testing.T) {
8181

8282
func TestWhileWithContext(t *testing.T) {
8383
a := assert.New(t)
84+
start := time.Now()
8485
ctx, canFunc := context.WithTimeout(context.Background(), 100*time.Millisecond)
8586
defer canFunc()
8687

87-
start := time.Now()
8888
out, err := async.WhileWithContext(ctx, func(ctx context.Context) bool {
8989
select {
9090
case <-ctx.Done():

0 commit comments

Comments
 (0)