Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

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 enabled auto-merge April 8, 2024 23:30
@crazytonyli crazytonyli merged commit ff552e0 into trunk Apr 8, 2024
@crazytonyli crazytonyli deleted the fix-upload-test-flakiness branch April 8, 2024 23:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants