Skip to content

Commit

Permalink
Fixing a rubicon race condition (prebid#597)
Browse files Browse the repository at this point in the history
* Added lots more race condition tests. Fixed a race condition.

* Removed a test I didnt mean to add.
  • Loading branch information
dbemiller authored Jun 29, 2018
1 parent c69649b commit af366eb
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 1 deletion.
3 changes: 3 additions & 0 deletions adapters/adform/adformtest/params/race/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"mid": "292063"
}
3 changes: 3 additions & 0 deletions adapters/adtelligent/adtelligenttest/params/race/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"aid": 350975
}
3 changes: 3 additions & 0 deletions adapters/adtelligent/adtelligenttest/params/race/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"aid": 331133
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"placementId": "555555555555555_555555555555555"
}
3 changes: 3 additions & 0 deletions adapters/conversant/conversanttest/params/race/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"site_id": "108060"
}
7 changes: 7 additions & 0 deletions adapters/conversant/conversanttest/params/race/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"site_id": "88563",
"api": [2],
"protocols": [1, 2],
"mimes": ["video/mp4"],
"maxduration": 5000
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"siteId": 500
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"siteId": 500
}
3 changes: 3 additions & 0 deletions adapters/lifestreet/lifestreettest/params/race/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"slot_tag": "slot166704"
}
3 changes: 3 additions & 0 deletions adapters/lifestreet/lifestreettest/params/race/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"slot_tag": "slot1227631"
}
4 changes: 4 additions & 0 deletions adapters/pubmatic/pubmatictest/params/race/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"publisherId": "156209",
"adSlot": "pubmatic_test2@300x250"
}
4 changes: 4 additions & 0 deletions adapters/pubmatic/pubmatictest/params/race/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"publisherId": "156209",
"adSlot": "pubmatic_test2@300x250"
}
5 changes: 5 additions & 0 deletions adapters/pulsepoint/pulsepointtest/params/race/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cf": "300X250",
"cp": 512379,
"ct": 486653
}
4 changes: 3 additions & 1 deletion adapters/rubicon/rubicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,10 @@ func (a *RubiconAdapter) MakeRequests(request *openrtb.BidRequest) ([]*adapters.
}

if thisImp.Video != nil {
videoCopy := *thisImp.Video
videoExt := rubiconVideoExt{Skip: rubiconExt.Video.Skip, SkipDelay: rubiconExt.Video.SkipDelay, RP: rubiconVideoExtRP{SizeID: rubiconExt.Video.VideoSizeID}}
thisImp.Video.Ext, err = json.Marshal(&videoExt)
videoCopy.Ext, err = json.Marshal(&videoExt)
thisImp.Video = &videoCopy
} else {
primarySizeID, altSizeIDs, err := parseRubiconSizes(thisImp.Banner.Format)
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions adapters/rubicon/rubicontest/params/race/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"accountId": 1001,
"siteId": 113932,
"zoneId": 535510
}
3 changes: 3 additions & 0 deletions adapters/sovrn/sovrntest/params/banner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tagId": "403370"
}
18 changes: 18 additions & 0 deletions exchange/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@ func newRaceCheckingRequest(t *testing.T) *openrtb.BidRequest {
ID: "some-publisher-id",
},
},
Device: &openrtb.Device{
UA: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36",
IFA: "ifa",
IP: "132.173.230.74",
DNT: 1,
Language: "EN",
},
Source: &openrtb.Source{
TID: "61018dc9-fa61-4c41-b7dc-f90b9ae80e87",
},
User: &openrtb.User{
ID: "our-id",
BuyerUID: "their-id",
Ext: openrtb.RawJSON(`{"consent":"BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw","digitrust":{"id":"digi-id","keyv":1,"pref":1}}`),
},
Regs: &openrtb.Regs{
Ext: openrtb.RawJSON(`{"gdpr":1}`),
},
Imp: []openrtb.Imp{{
ID: "some-imp-id",
Banner: &openrtb.Banner{
Expand Down

0 comments on commit af366eb

Please sign in to comment.