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

Deflake testURLParamsWithCardAndBankFundingSources #4549

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

wooj-stripe
Copy link
Collaborator

Summary

This test has about a 50% chance of failing. To remedy this, I am proposing we continue to deserialize as a Set(), but during encoding, convert to an orderedlist.

Motivation

Deflaking test

Testing

Using existing tests

Changelog

@wooj-stripe wooj-stripe marked this pull request as ready for review February 11, 2025 04:43
@wooj-stripe wooj-stripe requested review from a team as code owners February 11, 2025 04:43
davidme-stripe
davidme-stripe previously approved these changes Feb 11, 2025
mats-stripe
mats-stripe previously approved these changes Feb 11, 2025
Copy link
Collaborator

@mats-stripe mats-stripe left a comment

Choose a reason for hiding this comment

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

Drive-by review with one non-blocking suggestion

davidme-stripe
davidme-stripe previously approved these changes Feb 11, 2025
mats-stripe
mats-stripe previously approved these changes Feb 11, 2025
tillh-stripe
tillh-stripe previously approved these changes Feb 11, 2025
@@ -50,7 +50,7 @@ struct LinkURLParams: Encodable {
var intentMode: IntentMode
var setupFutureUsage: Bool
var cardBrandChoice: CardBrandChoiceInfo?
var linkFundingSources: Set<LinkSettings.FundingSource>
var linkFundingSources: [LinkSettings.FundingSource]
Copy link
Collaborator

Choose a reason for hiding this comment

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

The idea behind using a set was to not care about the ordering in this test (and in general), but I guess the custom Equatable implementation doesn’t really allow for that 😔

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue is that we're serializing it to JSON data, and we sort the keys when doing that, but if we use a Set then the ordering is non-deterministic during the test.

@wooj-stripe wooj-stripe merged commit 2de7606 into master Feb 11, 2025
6 checks passed
@wooj-stripe wooj-stripe deleted the wooj/deflakeLinktest branch February 11, 2025 20:03
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.

4 participants