File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 19
19
- name : Install dependencies
20
20
run : go mod tidy
21
21
- name : Run tests with coverage
22
- run : go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
22
+ run : go test ./... -coverprofile=./cover.out -covermode=atomic
23
23
- name : Upload coverage
24
24
uses : actions/upload-artifact@v4
25
25
with :
Original file line number Diff line number Diff line change @@ -356,18 +356,18 @@ func TestTokenManager_Start(t *testing.T) {
356
356
var last int32
357
357
wg := & sync.WaitGroup {}
358
358
359
+ idp .On ("RequestToken" ).Return (rawResponse , nil )
360
+ mParser .On ("ParseResponse" , rawResponse ).Return (testTokenValid , nil )
361
+ listener .On ("OnTokenNext" , testTokenValid ).Return ()
359
362
numExecutions := 50000
360
363
for i := 0 ; i < numExecutions ; i ++ {
361
364
wg .Add (1 )
362
365
go func (num int ) {
363
366
defer wg .Done ()
364
- time .Sleep (time .Duration (int64 (rand .Intn (1000 )) * int64 (time .Millisecond )))
367
+ time .Sleep (time .Duration (int64 (rand .Intn (100 )) * int64 (time .Millisecond )))
365
368
if num % 2 == 0 {
366
369
_ = tokenManager .Close ()
367
370
} else {
368
- idp .On ("RequestToken" ).Return (rawResponse , nil )
369
- mParser .On ("ParseResponse" , rawResponse ).Return (testTokenValid , nil )
370
- listener .On ("OnTokenNext" , testTokenValid ).Return ()
371
371
_ , _ = tokenManager .Start (listener )
372
372
}
373
373
atomic .StoreInt32 (& last , int32 (num ))
You can’t perform that action at this time.
0 commit comments