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: flakey deal tier test #3322

Merged
merged 1 commit into from
Nov 27, 2023
Merged

Conversation

bsardo
Copy link
Collaborator

@bsardo bsardo commented Nov 27, 2023

We're seeing occasional test suite failures related to the deal tier test TestReadDealTiersFromImp. The test case with description imp.ext.prebid.bidder - same bidder listed twice but with different case the last one prevails sometimes fails. This test case was recently added as part of the adapter name case insensitive initiative. The problem traces back to the fact that the function under test, ReadDealTiersFromImp, attempts to unmarshal imp.ext.prebid.bidder into type map[string]struct and then iterates over the map, normalizing each bidder name and ultimately selecting the deal tier information for the last occurrence of a given normalized bidder name. However, a map does not guarantee order so the order in which the keys are read from the map when iterating over it is unpredictable, which means we can't be sure which bidder name casing will be the last one encountered and ultimately selected.

The team discussed and determined that the unpredictable behavior is acceptable for this edge case so we should just update the test to ensure deduping occurs rather than verifying the details of the selected deal tier.

Copy link
Contributor

@AlexBVolcy AlexBVolcy left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@guscarreon guscarreon left a comment

Choose a reason for hiding this comment

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

LGTM

@bsardo bsardo merged commit 9cf8acc into prebid:master Nov 27, 2023
SuprPhatAnon pushed a commit to GiftConnect/prebid-server that referenced this pull request Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants