Skip to content

Clean up e2e test temp dirs on panic#565

Merged
DanGould merged 1 commit intopayjoin:masterfrom
arminsabouri:e2e-panic-handler
Mar 6, 2025
Merged

Clean up e2e test temp dirs on panic#565
DanGould merged 1 commit intopayjoin:masterfrom
arminsabouri:e2e-panic-handler

Conversation

@arminsabouri
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

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
@arminsabouri arminsabouri 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
@arminsabouri arminsabouri 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.

3 participants