File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import (
11
11
)
12
12
13
13
func TestBasic (t * testing.T ) {
14
- single := NewSingle [int ](time .Millisecond * 30 )
14
+ t .Parallel ()
15
+ single := NewSingle [int ](time .Millisecond * 200 )
15
16
foo := 0
16
17
shardCount := atomic .NewInt32 (0 )
17
18
call := func () (int , error ) {
18
19
foo ++
19
- time .Sleep (time .Millisecond * 5 )
20
+ time .Sleep (time .Millisecond * 20 )
20
21
return 0 , nil
21
22
}
22
23
@@ -39,23 +40,25 @@ func TestBasic(t *testing.T) {
39
40
}
40
41
41
42
func TestTimer (t * testing.T ) {
42
- single := NewSingle [int ](time .Millisecond * 30 )
43
+ t .Parallel ()
44
+ single := NewSingle [int ](time .Millisecond * 200 )
43
45
foo := 0
44
46
callM := func () (int , error ) {
45
47
foo ++
46
48
return 0 , nil
47
49
}
48
50
49
51
_ , _ , _ = single .Do (callM )
50
- time .Sleep (10 * time .Millisecond )
52
+ time .Sleep (100 * time .Millisecond )
51
53
_ , _ , shard := single .Do (callM )
52
54
53
55
assert .Equal (t , 1 , foo )
54
56
assert .True (t , shard )
55
57
}
56
58
57
59
func TestReset (t * testing.T ) {
58
- single := NewSingle [int ](time .Millisecond * 30 )
60
+ t .Parallel ()
61
+ single := NewSingle [int ](time .Millisecond * 200 )
59
62
foo := 0
60
63
callM := func () (int , error ) {
61
64
foo ++
You can’t perform that action at this time.
0 commit comments