Skip to content

Commit

Permalink
[#234] t.Fatalf -> t.Errorf in go routines (#266)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gdey authored and nathany committed Aug 30, 2018
1 parent 70cc4a1 commit 8ba2b19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion integration_darwin_test.go
Expand Up @@ -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)
}
}()

Expand Down
16 changes: 8 additions & 8 deletions integration_test.go
Expand Up @@ -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)
}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down

0 comments on commit 8ba2b19

Please sign in to comment.