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

feat(browser_manager): enable full XPI cleanup #1104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 52.63158% with 9 lines in your changes missing coverage. Please review.

Project coverage is 39.20%. Comparing base (d1a60fb) to head (c3e48f6).
Report is 2 commits behind head on master.

Files Patch % Lines
openwpm/browser_manager.py 53.33% 7 Missing ⚠️
openwpm/deploy_browsers/deploy_firefox.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1104      +/-   ##
==========================================
+ Coverage   35.24%   39.20%   +3.96%     
==========================================
  Files          35       35              
  Lines        3473     3492      +19     
==========================================
+ Hits         1224     1369     +145     
+ Misses       2249     2123     -126     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it 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.
@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

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