From 8ba2b192bd2e582f86863c93eaae257727d3c13d Mon Sep 17 00:00:00 2001 From: Gautam Dey Date: Thu, 30 Aug 2018 14:59:23 -0600 Subject: [PATCH] [#234] t.Fatalf -> t.Errorf in go routines (#266) The documentation for t.FailNow (which is called by t.Fatalf) states that it should not be called in go routines outside of the test go routine. --- integration_darwin_test.go | 2 +- integration_test.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/integration_darwin_test.go b/integration_darwin_test.go index cd6adc27..553767c3 100644 --- a/integration_darwin_test.go +++ b/integration_darwin_test.go @@ -55,7 +55,7 @@ func testExchangedataForWatcher(t *testing.T, watchDir bool) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() diff --git a/integration_test.go b/integration_test.go index 8b7e9d3e..7096344d 100644 --- a/integration_test.go +++ b/integration_test.go @@ -194,7 +194,7 @@ func TestFsnotifyMultipleCreates(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() @@ -339,7 +339,7 @@ func TestFsnotifyDirOnly(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() @@ -444,7 +444,7 @@ func TestFsnotifyDeleteWatchedDir(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() @@ -489,7 +489,7 @@ func TestFsnotifySubDir(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() @@ -581,7 +581,7 @@ func TestFsnotifyRename(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() @@ -663,7 +663,7 @@ func TestFsnotifyRenameToCreate(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() @@ -756,7 +756,7 @@ func TestFsnotifyRenameToOverwrite(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }() @@ -874,7 +874,7 @@ func TestFsnotifyAttrib(t *testing.T) { // Receive errors on the error channel on a separate goroutine go func() { for err := range watcher.Errors { - t.Fatalf("error received: %s", err) + t.Errorf("error received: %s", err) } }()