From 882cecd6a6eae962055343761d4d21cb65660c25 Mon Sep 17 00:00:00 2001 From: Luca Bigliardi Date: Sat, 27 Mar 2021 16:45:00 +0100 Subject: [PATCH] simplify half connected test Signed-off-by: Luca Bigliardi --- irc_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/irc_test.go b/irc_test.go index 5a521c5..f61b1fc 100644 --- a/irc_test.go +++ b/irc_test.go @@ -555,7 +555,7 @@ func TestStopRunningWhenHalfConnected(t *testing.T) { config := makeTestIRCConfig(port) notifier, _, ctx, cancel, stopWg := makeTestNotifier(t, config) - var testStep, holdQuitWait sync.WaitGroup + var testStep sync.WaitGroup // Send a StopRunning request while the client is connected but the // session is not up @@ -567,15 +567,6 @@ func TestStopRunningWhenHalfConnected(t *testing.T) { } server.SetHandler("USER", holdUser) - // Ignore quit, but wait for it to have deterministic test commands - holdQuitWait.Add(1) - holdQuit := func(conn *bufio.ReadWriter, line *irc.Line) error { - log.Printf("=Server= Ignoring quit") - holdQuitWait.Done() - return nil - } - server.SetHandler("QUIT", holdQuit) - go notifier.Run(ctx, stopWg) testStep.Wait() @@ -583,8 +574,6 @@ func TestStopRunningWhenHalfConnected(t *testing.T) { cancel() stopWg.Wait() - holdQuitWait.Wait() - // Client has left, cleanup the server side before stopping server.Client.Close()