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

Clean up e2e test temp dirs on panic #565

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

0xBEEFCAF3
Copy link
Collaborator

Decided against using panic hooks for this work as the moving the PathBufs ended up looking ugly. Instead we introduce a CleanupGuard struct which when dropped will clean up the temp PathBufs. For this I needed to refactor cleanup_temp_file to use std::fs sync method instead of tokio::fs as Drop does not have access to the async runtime.

Issue: #564

Verified

This commit was signed with the committer’s verified signature.
0xBEEFCAF3 Armin Sabouri
Decided against using panic hooks for this work as the moving the
`PathBufs` ended up looking ugly. Instead we introduce a `CleanupGuard`
struct which when dropped will clean up the temp `PathBufs`. For this I
needed to refactor `cleanup_temp_file` to use `std::fs` sync method
instead of `tokio::fs` as `Drop` does not have access to the async runtime.

Issue: payjoin#564
@0xBEEFCAF3 0xBEEFCAF3 requested a review from DanGould March 6, 2025 16:28
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 13703437770

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 79.634%

Totals Coverage Status
Change from base Build 13701515576: 0.0%
Covered Lines: 4528
Relevant Lines: 5686

💛 - Coveralls

Copy link
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

So much better. Thanks for the elegant solution.

ACK 31f206e

@DanGould DanGould merged commit 5529df3 into payjoin:master Mar 6, 2025
7 checks passed
@0xBEEFCAF3 0xBEEFCAF3 deleted the e2e-panic-handler branch March 7, 2025 01:18
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.

None yet

3 participants