Skip to content

Commit b060920

Browse files
committed
labeler: fix false-failure with nfd file removal test
Signed-off-by: Tuomas Katila <[email protected]>
1 parent b505897 commit b060920

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)