Cancel reconnect retries during shutdown
This commit is contained in:
committed by
Brandon McGinty
parent
e68546eec5
commit
1d6ab79ed0
@@ -193,6 +193,23 @@ func TestCleanupConnectionAudioIsIdempotent(t *testing.T) {
|
||||
|
||||
// Tone test mode intentionally does not create an OpenAL stream. Tree
|
||||
// controls must therefore keep local mute state without trying to update one.
|
||||
func TestReconnectCancellationIsSafeBeforeStartup(t *testing.T) {
|
||||
b := &Barnard{}
|
||||
b.stopReconnects()
|
||||
if b.reconnectCanceled() {
|
||||
t.Fatal("nil reconnect channel should not report cancellation")
|
||||
}
|
||||
}
|
||||
|
||||
func TestReconnectCancellationStopsWaiters(t *testing.T) {
|
||||
b := &Barnard{reconnectStop: make(chan struct{})}
|
||||
b.stopReconnects()
|
||||
if !b.reconnectCanceled() {
|
||||
t.Fatal("expected reconnect cancellation")
|
||||
}
|
||||
b.stopReconnects() // repeated shutdown must not panic
|
||||
}
|
||||
|
||||
func TestUpdateUserGainAllowsToneTestWithoutStream(t *testing.T) {
|
||||
(&Barnard{ToneTest: true}).updateUserGain(&gumble.User{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user