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

Fix looking up multipart form temporary files #781

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

crazytonyli
Copy link
Contributor

Fixes flaky unit tests.


  • Please check here if your pull request includes additional test coverage.
  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

@crazytonyli crazytonyli requested a review from guarani April 8, 2024 01:13
Copy link
Contributor

@mokagio mokagio left a comment

Choose a reason for hiding this comment

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

Nice! Thank you.

Copy link
Contributor

@guarani guarani left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @crazytonyli! Tested locally and working great 🙇

result.insert(file)
let files = try fm.contentsOfDirectory(atPath: fm.temporaryDirectory.path)
.filter {
uuidRegex.numberOfMatches(in: $0, range: NSMakeRange(0, $0.count)) == 1
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: this also works:

Suggested change
uuidRegex.numberOfMatches(in: $0, range: NSMakeRange(0, $0.count)) == 1
UUID(uuidString: $0) != nil

and avoids the long regex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for suggestion! Addressed in a7f9297

@crazytonyli crazytonyli merged commit ff552e0 into trunk Apr 8, 2024
8 of 9 checks passed
@crazytonyli crazytonyli deleted the fix-upload-test-flakiness branch April 8, 2024 23:34
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