Skip to content

feat(browser_manager): enable full XPI cleanup#1104

Open
vringar wants to merge 1 commit intomasterfrom
delete_tmpdir
Open

feat(browser_manager): enable full XPI cleanup#1104
vringar wants to merge 1 commit intomasterfrom
delete_tmpdir

Conversation

@vringar
Copy link
Contributor

@vringar vringar commented Aug 7, 2024

No description provided.

@vringar vringar force-pushed the delete_tmpdir branch 4 times, most recently from 150d0da to aa60700 Compare August 7, 2024 17:01
@vringar vringar changed the title Delete tmpdir feat(browser_manager): enable full XPI cleanup Aug 7, 2024
@codecov
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

❌ Patch coverage is 57.14286% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.32%. Comparing base (c438c9f) to head (9eae121).

Files with missing lines Patch % Lines
openwpm/browser_manager.py 58.82% 7 Missing ⚠️
openwpm/deploy_browsers/deploy_firefox.py 0.00% 2 Missing ⚠️

❌ Your project check has failed because the head coverage (35.32%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1104      +/-   ##
==========================================
+ Coverage   35.19%   35.32%   +0.13%     
==========================================
  Files          35       35              
  Lines        3475     3496      +21     
==========================================
+ Hits         1223     1235      +12     
- Misses       2252     2261       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ndanner-wesleyancs
Copy link

Do you need me to do anything more on this? I'm not well versed in CI/Codecov/etc., so I'm not sure where things stand based on what I see here.

@vringar
Copy link
Contributor Author

vringar commented Aug 10, 2024

I haven't fully figured out what is causing these but I've also been focusing on #1103
I don't think you need to do anything else here

Set TMPDIR in the environment to a unique directory for each browser
instance and delete it when the browser quits.

This is a workaround for an issue with geckodriver.  When the OpenWPM
extension is installed via `WebDriver.install_addon()`, geckodriver
makes a copy of the XPI file in TMPDIR.  However, geckodriver never
deletes that file.  So on a stateless crawl, you end up with one copy of
the XPI file for each site visited.

This workaround sets TMPDIR in the environment before creating the
geckodriver service, and then deletes the directory after
`driver.quit()` returns in `BrowserManager.run()`.  We use this
indirection because we don't have access to the name of the temporary
file, and it doesn't seem safe to just delete XPI files in /tmp.
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

Comments