@@ -43,7 +43,7 @@ func (b *fakeBus) latest() []string {
4343// 4. the onPanic callback fires with the panic value
4444func TestL11PluginPanicSurvival (t * testing.T ) {
4545 t .Parallel ()
46- ResetPluginRecoveredPanicCountForTest ()
46+ before := PluginRecoveredPanicCount ()
4747 bus := & fakeBus {}
4848
4949 var (
@@ -65,7 +65,7 @@ func TestL11PluginPanicSurvival(t *testing.T) {
6565 }()
6666 wg .Wait ()
6767
68- if PluginRecoveredPanicCount () == 0 {
68+ if PluginRecoveredPanicCount () <= before {
6969 t .Fatal ("L11 boundary did not record the panic" )
7070 }
7171
@@ -95,7 +95,7 @@ func TestL11PluginPanicSurvival(t *testing.T) {
9595// bus is provided (e.g., the standalone nameserver binary).
9696func TestL11PluginPanicNilBus (t * testing.T ) {
9797 t .Parallel ()
98- ResetPluginRecoveredPanicCountForTest ()
98+ before := PluginRecoveredPanicCount ()
9999 var wg sync.WaitGroup
100100 wg .Add (1 )
101101 go func () {
@@ -104,7 +104,7 @@ func TestL11PluginPanicNilBus(t *testing.T) {
104104 panic ("nil-bus panic" )
105105 }()
106106 wg .Wait ()
107- if PluginRecoveredPanicCount () == 0 {
107+ if PluginRecoveredPanicCount () <= before {
108108 t .Fatal ("L11 boundary did not record nil-bus panic" )
109109 }
110110}
@@ -113,7 +113,7 @@ func TestL11PluginPanicNilBus(t *testing.T) {
113113// against a panicking onPanic callback.
114114func TestL11PluginPanicCallbackPanicSwallowed (t * testing.T ) {
115115 t .Parallel ()
116- ResetPluginRecoveredPanicCountForTest ()
116+ before := PluginRecoveredPanicCount ()
117117 var wg sync.WaitGroup
118118 wg .Add (1 )
119119 go func () {
@@ -124,7 +124,7 @@ func TestL11PluginPanicCallbackPanicSwallowed(t *testing.T) {
124124 panic ("primary panic" )
125125 }()
126126 wg .Wait ()
127- if PluginRecoveredPanicCount () == 0 {
127+ if PluginRecoveredPanicCount () <= before {
128128 t .Fatal ("L11 boundary did not record the primary panic" )
129129 }
130130}
0 commit comments