mirror of
https://github.com/strukturag/nextcloud-spreed-signaling.git
synced 2023-10-21 07:33:40 -05:00
Run function to test for goroutine leaks as subtest.
This makes sure the test has been completely teared down before the goroutines are counted and thus should prevent flaky failed tests.
This commit is contained in:
@@ -60,7 +60,7 @@ func CreateLoopbackNatsClientForTest(t *testing.T) NatsClient {
|
||||
}
|
||||
|
||||
func TestLoopbackNatsClient_Subscribe(t *testing.T) {
|
||||
ensureNoGoroutinesLeak(t, func() {
|
||||
ensureNoGoroutinesLeak(t, func(t *testing.T) {
|
||||
client := CreateLoopbackNatsClientForTest(t)
|
||||
|
||||
testNatsClient_Subscribe(t, client)
|
||||
@@ -68,7 +68,7 @@ func TestLoopbackNatsClient_Subscribe(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLoopbackClient_PublishAfterClose(t *testing.T) {
|
||||
ensureNoGoroutinesLeak(t, func() {
|
||||
ensureNoGoroutinesLeak(t, func(t *testing.T) {
|
||||
client := CreateLoopbackNatsClientForTest(t)
|
||||
|
||||
testNatsClient_PublishAfterClose(t, client)
|
||||
@@ -76,7 +76,7 @@ func TestLoopbackClient_PublishAfterClose(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLoopbackClient_SubscribeAfterClose(t *testing.T) {
|
||||
ensureNoGoroutinesLeak(t, func() {
|
||||
ensureNoGoroutinesLeak(t, func(t *testing.T) {
|
||||
client := CreateLoopbackNatsClientForTest(t)
|
||||
|
||||
testNatsClient_SubscribeAfterClose(t, client)
|
||||
@@ -84,7 +84,7 @@ func TestLoopbackClient_SubscribeAfterClose(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLoopbackClient_BadSubjects(t *testing.T) {
|
||||
ensureNoGoroutinesLeak(t, func() {
|
||||
ensureNoGoroutinesLeak(t, func(t *testing.T) {
|
||||
client := CreateLoopbackNatsClientForTest(t)
|
||||
|
||||
testNatsClient_BadSubjects(t, client)
|
||||
|
||||
Reference in New Issue
Block a user