pion / stun

A Go implementation of STUN
https://pion.ly/
MIT License
616 stars 94 forks source link

TestClientGC hangs #91

Closed at-wat closed 1 year ago

at-wat commented 3 years ago

https://github.com/pion/stun/pull/90/checks?check_run_id=3093408033

=== RUN   TestClientGC
coverage: 47.1
panic: test timed out after 10m0s

goroutine 82 [running]:
testing.(*M).startAlarm.func1()
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1618 +0x11f
created by time.goFunc
    /opt/hostedtoolcache/go/1.15.13/x64/src/time/sleep.go:167 +0x52

goroutine 1 [chan receive]:
testing.(*T).Run(0xc000001980, 0x749132, 0xc, 0x755f10, 0x1)
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1169 +0x5f4
testing.runTests.func1(0xc000001980)
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1439 +0xa7
testing.tRunner(0xc000001980, 0xc00007dc78)
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1123 +0x203
testing.runTests(0xc00000e0c0, 0x8eee60, 0x73, 0x73, 0xc034d8ee4e87ed1a, 0x8bb2e65df0, 0x8f1ce0, 0x44af65)
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1437 +0x613
testing.(*M).Run(0xc000142000, 0x0)
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1345 +0x3b4
main.main()
    _testmain.go:451 +0x357

goroutine 79 [semacquire]:
sync.runtime_Semacquire(0xc0000aa460)
    /opt/hostedtoolcache/go/1.15.13/x64/src/runtime/sema.go:56 +0x45
sync.(*WaitGroup).Wait(0xc0000aa458)
    /opt/hostedtoolcache/go/1.15.13/x64/src/sync/waitgroup.go:130 +0xe5
github.com/pion/stun.(*tickerCollector).Close(0xc0000aa450, 0x1, 0x9)
    /home/runner/work/stun/stun/client.go:377 +0x7a
github.com/pion/stun.(*Client).Close(0xc0001206e0, 0x468959, 0x755f08)
    /home/runner/work/stun/stun/client.go:396 +0x162
github.com/pion/stun.TestClientGC.func2(0xc0001206e0, 0xc000049e20, 0xc0000ca180)
    /home/runner/work/stun/stun/client_test.go:575 +0x3d
github.com/pion/stun.TestClientGC(0xc0000ca180)
    /home/runner/work/stun/stun/client_test.go:584 +0x546
testing.tRunner(0xc0000ca180, 0x755f10)
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1123 +0x203
created by testing.(*T).Run
    /opt/hostedtoolcache/go/1.15.13/x64/src/testing/testing.go:1168 +0x5bc

goroutine 80 [chan send]:
github.com/pion/stun.(*gcWaitAgent).Collect(0xc000010040, 0xc034d85852371d0f, 0x3cc1de5, 0x8f1ce0, 0x8f1ce0, 0x3cc1de5)
    /home/runner/work/stun/stun/client_test.go:543 +0x56
github.com/pion/stun.NewClient.func1(0xc034d85852371d0f, 0x3cc1de5, 0x8f1ce0)
    /home/runner/work/stun/stun/client.go:147 +0xa3
github.com/pion/stun.(*tickerCollector).Start.func1(0xc0000aa450, 0xc000067040, 0xc0000a27a0)
    /home/runner/work/stun/stun/client.go:368 +0x10d
created by github.com/pion/stun.(*tickerCollector).Start
    /home/runner/work/stun/stun/client.go:360 +0xb2

goroutine 81 [runnable]:
github.com/pion/stun.(*Message).Decode(0xc0001604b0, 0xc000000001, 0xe1738bf)
    /home/runner/work/stun/stun/message.go:371 +0x546
github.com/pion/stun.(*Message).ReadFrom(0xc0001604b0, 0x7fe42eb44008, 0xc000012b80, 0x7fe42eb44008, 0xc000012b80, 0x0)
    /home/runner/work/stun/stun/message.go:340 +0x17b
github.com/pion/stun.(*Client).readUntilClosed(0xc0001206e0)
    /home/runner/work/stun/stun/client.go:327 +0x22a
created by github.com/pion/stun.NewClient
    /home/runner/work/stun/stun/client.go:152 +0x647
FAIL    github.com/pion/stun    600.027s
FAIL
stv0g commented 1 year ago

I assume this is outdated?

The test succeeds for me:

stv0g@ubuntu:~/workspace/pion/stun$ go test -run TestClientGC -v .
=== RUN   TestClientGC
--- PASS: TestClientGC (0.00s)
PASS
ok      github.com/pion/stun    (cached)

Please feel free to re-open if you still encounter the issue.