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

Avoid using a temporary file to store screenshot after a test failure #1855

Merged

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Dec 3, 2024

Temporary files are created with permissions 600, differing from defined umask. For the screenshot file that is later attached as diagnostic, this can cause permission issues in some environments.

Tested by arbitrary failing a test and checking permissions set on resulting screenshot.png that can be found under target/diagnostics/{testName}/screenshot.png.
In my case 644 instead of 600.

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Temporary files are created with 600, differing from defined umask.
For the screenshot file that is later attached as diagnostic, this can cause permission issues in some environments.
@Vlatombe Vlatombe requested a review from jglick December 3, 2024 15:02
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Pity https://www.javadoc.io/doc/org.seleniumhq.selenium/selenium-api/2.52.0/org/openqa/selenium/OutputType.html has no OutputStream option. I guess one screenshot will be small enough to have negligible memory impact.

@jglick jglick merged commit ad3e0ee into jenkinsci:master Dec 4, 2024
25 checks passed
@Vlatombe Vlatombe deleted the avoid-temporary-file-for-screenshot branch December 4, 2024 13:28
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