Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spurious failure when two tests try to remove ptf.log at the same time. #4591

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

fruffy
Copy link
Collaborator

@fruffy fruffy commented Apr 1, 2024

It can happen that test A deletes ptf.log and then test B tries to delete the log a second later. This will cause the following error:

WARNING: Traceback (most recent call last):
WARNING:   File "/usr/local/bin/ptf", line 684, in <module>
WARNING:     logging_setup(config)
WARNING:   File "/usr/local/bin/ptf", line 449, in logging_setup
WARNING:     os.remove(config["log_file"])
WARNING: FileNotFoundError: [Errno 2] No such file or directory: 'ptf.log'

To avoid that from happening we make sure the log is saved in the unique temporary directory instead. We already did this for the actual PTF test, but not for the initial PTF check.

Ideally, we would fix this error from occurring at all in PTF.

@fruffy fruffy requested a review from jafingerhut April 1, 2024 20:36
Copy link
Contributor

@jafingerhut jafingerhut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jafingerhut jafingerhut added this pull request to the merge queue Apr 3, 2024
Merged via the queue into main with commit 7b62006 Apr 3, 2024
17 checks passed
@jafingerhut jafingerhut deleted the fruffy/ptf_spurious_failure branch April 3, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants