Sfoglia il codice sorgente

http2: reset DebugGoroutines after testing it

Return DebugGoroutines to its original setting after
turning it on for the test.

Change-Id: I860f3b03d3736617657f124f957efe89fbe12104
Reviewed-on: https://go-review.googlesource.com/18070
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Jeff R. Allen 10 anni fa
parent
commit
6c89489caf
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      http2/gotrack_test.go

+ 3 - 0
http2/gotrack_test.go

@@ -11,7 +11,10 @@ import (
 )
 )
 
 
 func TestGoroutineLock(t *testing.T) {
 func TestGoroutineLock(t *testing.T) {
+	oldDebug := DebugGoroutines
 	DebugGoroutines = true
 	DebugGoroutines = true
+	defer func() { DebugGoroutines = oldDebug }()
+
 	g := newGoroutineLock()
 	g := newGoroutineLock()
 	g.check()
 	g.check()