File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ func main() {
43
43
wg .Add (10 )
44
44
for i := 0 ; i < 10 ; i ++ {
45
45
go func (num int ) {
46
+ defer wg .Done ()
46
47
span := tx .StartChild (fmt .Sprintf ("Goroutine %d" , num ))
47
48
defer span .Finish ()
48
49
for i := 0 ; i < num ; i ++ {
49
50
_ = findPrimeNumber (50000 )
50
51
runtime .Gosched () // we need to manually yield this busy loop
51
52
}
52
53
fmt .Printf ("routine %d done\n " , num )
53
- wg .Done ()
54
54
}(i )
55
55
}
56
56
wg .Wait ()
Original file line number Diff line number Diff line change @@ -448,8 +448,6 @@ func TestHTTPTransport(t *testing.T) {
448
448
}
449
449
}
450
450
451
- // Actual tests
452
-
453
451
testSendSingleEvent := func (t * testing.T ) {
454
452
// Sending a single event should increase the server event count by
455
453
// exactly one.
@@ -467,6 +465,8 @@ func TestHTTPTransport(t *testing.T) {
467
465
transportMustFlush (t , id )
468
466
serverEventCountMustBe (t , initialCount + 1 )
469
467
}
468
+
469
+ // Actual tests
470
470
t .Run ("SendSingleEvent" , testSendSingleEvent )
471
471
472
472
t .Run ("FlushMultipleTimes" , func (t * testing.T ) {
@@ -485,12 +485,12 @@ func TestHTTPTransport(t *testing.T) {
485
485
var wg sync.WaitGroup
486
486
wg .Add (2 )
487
487
go func () {
488
+ defer wg .Done ()
488
489
testSendSingleEvent (t )
489
- wg .Done ()
490
490
}()
491
491
go func () {
492
+ defer wg .Done ()
492
493
transportMustFlush (t , "from goroutine" )
493
- wg .Done ()
494
494
}()
495
495
wg .Wait ()
496
496
})
You can’t perform that action at this time.
0 commit comments