Skip to content

Commit 4410cd3

Browse files
authored
Merge pull request #1856 from tkatila/labeler-fix-false-failure
labeler: fix false-failure with nfd file removal test
2 parents 59f4d17 + b060920 commit 4410cd3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/internal/labeler/labeler_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,11 @@ func TestCreateAndRun(t *testing.T) {
773773

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

0 commit comments

Comments
 (0)