Skip to content

Commit

Permalink
Merge pull request #1856 from tkatila/labeler-fix-false-failure
Browse files Browse the repository at this point in the history
labeler: fix false-failure with nfd file removal test
  • Loading branch information
mythi authored Oct 1, 2024
2 parents 59f4d17 + b060920 commit 4410cd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/internal/labeler/labeler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,11 @@ func TestCreateAndRun(t *testing.T) {

// Wait for the labeling timeout to trigger
if !waitForFileOp(root, nfdLabelBase, fsnotify.Remove, time.Second*2) {
t.Error("Run didn't remove label file")
// It's possible that removal happened before we started waiting.
// Only fail the test if the file still exists.
if _, err := os.Stat(nfdLabelFile); err == nil {
t.Error("Run didn't remove label file")
}
}
})
}
Expand Down

0 comments on commit 4410cd3

Please sign in to comment.