From 1a4b5a05b25a6002d7cebf392d63f62c11e63708 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Thu, 16 Feb 2017 18:35:50 +0100 Subject: [PATCH] terminal/command_test: improved TestIssue387 The test in question tries to 'next' over a call to wg.Done, this is not guaranteed to succeed, if the goroutine gets suspended after wg.Done has notified the waiting group but before returning to main.dostuff the program could quit before the goroutine is resumed. --- pkg/terminal/command_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/terminal/command_test.go b/pkg/terminal/command_test.go index 5c8da193..3c49d702 100644 --- a/pkg/terminal/command_test.go +++ b/pkg/terminal/command_test.go @@ -458,7 +458,7 @@ func TestIssue387(t *testing.T) { t.Fatalf("did not continue to expected position %d", pos) } pos++ - if pos > 11 { + if pos >= 11 { break } }