[ANE-2237] make the preflight check filename unique #1498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
In ANE-2237, Lukas from SEW Eurodrive reported that the preflight check was failing around 10% of the time on their CI instance.
This was happening because they were running multiple runs of
fossa
in parallel, so the processes were sometimes deleting the preflight check file created by another instance offossa
, and it was raising an error when it tried to delete the nonexistent file.Two obvious ways to fix this are to just not fail if you can't delete or to make the filename unique. I opted for the unique filename approach, but I have no strong opinion here.
Acceptance criteria
Testing plan
I was able to repro the initial problem by running this in one terminal:
and then running
fossa report
a bunch of times in another:That's no longer going to reproduce the problem. So I just put in some logging and validated that the filename being returned by preflightCheckFilename was different between runs.
Risks
This is low risk
Metrics
References
ANE-2237
Checklist
docs/
.docs/README.ms
and gave consideration to how discoverable or not my documentation is.Changelog.md
. If this PR did not mark a release, I added my changes into an## Unreleased
section at the top..fossa.yml
orfossa-deps.{json.yml}
, I updateddocs/references/files/*.schema.json
AND I have updated example files used byfossa init
command. You may also need to update these if you have added/removed new dependency type (e.g.pip
) or analysis target type (e.g.poetry
).docs/references/subcommands/<subcommand>.md
.