This is an archive of the discontinued LLVM Phabricator instance.

[XRay] Reduce overly broad 'rm' command in lit test
ClosedPublic

Authored by jmorse on Sep 27 2018, 4:03 AM.

Details

Reviewers
dberris
Summary

This command is supposed to clean up temporary log files from this
test, but winds up cleaning all xray log files in the cwd, which can
interfere with other test processes.

We've seen this internally as errors such as:

rm: cannot remove 'xray-log.c-test.cc.tmp.bFiBJc': No such file or directory

Where the shell has globbed the logfile for a different test (c-test.cc here)
but a concurrent test process has deleted it by the time rm gets to running.

Diff Detail

Event Timeline

jmorse created this revision.Sep 27 2018, 4:03 AM
Herald added subscribers: Restricted Project, llvm-commits. · View Herald TranscriptSep 27 2018, 4:03 AM
dberris accepted this revision.Sep 27 2018, 6:44 AM

LGTM -- Thanks!

This revision is now accepted and ready to land.Sep 27 2018, 6:44 AM
jmorse closed this revision.Sep 28 2018, 2:11 AM

Fixed concurrently by r343282!

MaskRay added a subscriber: MaskRay.EditedOct 1 2018, 10:10 AM

Fixed concurrently by r343282!

:)

I missed another race in the description. There are two:

  • rm can delete files of other tests and cause them to fail
  • shell may expand file names first but when rm tries deleting them, other tests have already deleted the files and cause the test to fail.