prebid / prebid-server-java

Java version of Prebid Server
Apache License 2.0
68 stars 175 forks source link

Failing tests on latest build #338

Closed vinnybod closed 5 years ago

vinnybod commented 5 years ago

Getting a lot of errors trying to build the latest version using Java 1.8

[ERROR] Failures: 
[ERROR]   ApplicationTest.auctionShouldRespondWithBidsFromAdform:315 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   ApplicationTest.auctionShouldRespondWithBidsFromAppnexusAlias:258 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   ApplicationTest.auctionShouldRespondWithBidsFromRubiconAndAppnexus:379 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   ApplicationTest.eventHandlerShouldRespondWithJPGTrackingPixel:605 
Expecting:
 <X-Powered-By=Express
Accept-Ranges=bytes
Content-Type=text/html; charset=UTF-8
ETag=W/"794-UB50IUnoMR3/XIi4KYsfcY3KqHk"
Vary=Accept-Encoding
Content-Encoding=gzip
Date=Tue, 16 Apr 2019 22:32:25 GMT
Connection=keep-alive
Transfer-Encoding=chunked>
to contain:
 <[content-type=image/jpeg]>
but could not find:
 <[content-type=image/jpeg]>

[ERROR]   ApplicationTest.infoBidderDetailsShouldReturnMetadataForBidder:592 1 expectation failed.
Response body doesn't match expectation.
Expected: "{\"enabled\":true,\"maintainer\":{\"email\":\"header-bidding@rubiconproject.com\"},\"capabilities\":{\"app\":{\"mediaTypes\":[\"banner\"]},\"site\":{\"mediaTypes\":[\"banner\",\"video\"]}},\"vendors\":[\"activeview\",\"adform\",\"comscore\",\"doubleverify\",\"integralads\",\"moat\",\"sizemek\",\"whiteops\"],\"gdpr\":{\"vendorId\":52,\"enforced\":true}}"
  Actual: <!DOCTYPE html>
<html lang="en">
<head>
  <base href="/">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
  <meta name="theme-color" content="#00C389">
  <link rel="icon" href="./favicon.ico?v=3">
  <link rel="stylesheet" type="text/css" href="./vendor.css" />
  <title>Freestar Dashboard</title>
  <script>
    if (window.navigator && navigator.serviceWorker) {
      navigator.serviceWorker.getRegistrations()
        .then(function(registrations) {
          for(let registration of registrations) {
            registration.unregister();
          }
        });
    }
    window.appEnv = 'prod';
    if (window.location.hostname === 'dev-dashboard.freestar.io') {
      window.appEnv = 'dev';
    } else if (window.location.hostname === 'localhost') {
      window.appEnv = 'local';
    }
  </script>
<link href="/app.js" rel="preload" as="script"></head>

<body>
  <noscript>
    <strong>We're sorry but sample doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  </noscript>
  <div id="app"></div>
  <!-- built files will be auto injected -->

  <script src="./vendor.js"></script>
  <script>
    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
    var isLocal = window.location.hostname.indexOf('localhost') > -1;
    ga('create', 'UA-91235006-1', 'auto');
    ga('set', 'forceSSL', isLocal === true ? false : true);
  </script>
  <script>
    var _hsq = window._hsq = window._hsq || [];
    _hsq.push(['setPath', window.location.pathname]);
  </script>
  <script type="text/javascript" id="hs-script-loader" async defer src="https://js.hs-scripts.com/3894644.js"></script>
  <script async src="https://www.google-analytics.com/analytics.js"></script>
<script type="text/javascript" src="/app.js"></script></body>

</html>

[ERROR]   ApplicationTest.optionsRequestShouldRespondWithOriginalPolicyHeaders:549 expected:<"true"> but was:<null>
[ERROR]   ApplicationTest.optoutShouldSetOptOutFlagAndRedirectToOptOutUrl:414 expected:<[301]> but was:<[404]>
[ERROR]   ApplicationTest.statusShouldReturnReadyWithinResponseBodyAndHttp200Ok:395 
Expecting:
  <[200,
    "<!DOCTYPE html>
<html lang="en">
<head>
  <base href="/">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
  <meta name="theme-color" content="#00C389">
  <link rel="icon" href="./favicon.ico?v=3">
  <link rel="stylesheet" type="text/css" href="./vendor.css" />
  <title>Freestar Dashboard</title>
  <script>
    if (window.navigator && navigator.serviceWorker) {
      navigator.serviceWorker.getRegistrations()
        .then(function(registrations) {
          for(let registration of registrations) {
            registration.unregister();
          }
        });
    }
    window.appEnv = 'prod';
    if (window.location.hostname === 'dev-dashboard.freestar.io') {
      window.appEnv = 'dev';
    } else if (window.location.hostname === 'localhost') {
      window.appEnv = 'local';
    }
  </script>
<link href="/app.js" rel="preload" as="script"></head>

<body>
  <noscript>
    <strong>We're sorry but sample doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  </noscript>
  <div id="app"></div>
  <!-- built files will be auto injected -->

  <script src="./vendor.js"></script>
  <script>
    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
    var isLocal = window.location.hostname.indexOf('localhost') > -1;
    ga('create', 'UA-91235006-1', 'auto');
    ga('set', 'forceSSL', isLocal === true ? false : true);
  </script>
  <script>
    var _hsq = window._hsq = window._hsq || [];
    _hsq.push(['setPath', window.location.pathname]);
  </script>
  <script type="text/javascript" id="hs-script-loader" async defer src="https://js.hs-scripts.com/3894644.js"></script>
  <script async src="https://www.google-analytics.com/analytics.js"></script>
<script type="text/javascript" src="/app.js"></script></body>

</html>
"]>
to contain only:
  <[200, "ok"]>
elements not found:
  <["ok"]>
and elements not expected:
  <["<!DOCTYPE html>
<html lang="en">
<head>
  <base href="/">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
  <meta name="theme-color" content="#00C389">
  <link rel="icon" href="./favicon.ico?v=3">
  <link rel="stylesheet" type="text/css" href="./vendor.css" />
  <title>Freestar Dashboard</title>
  <script>
    if (window.navigator && navigator.serviceWorker) {
      navigator.serviceWorker.getRegistrations()
        .then(function(registrations) {
          for(let registration of registrations) {
            registration.unregister();
          }
        });
    }
    window.appEnv = 'prod';
    if (window.location.hostname === 'dev-dashboard.freestar.io') {
      window.appEnv = 'dev';
    } else if (window.location.hostname === 'localhost') {
      window.appEnv = 'local';
    }
  </script>
<link href="/app.js" rel="preload" as="script"></head>

<body>
  <noscript>
    <strong>We're sorry but sample doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  </noscript>
  <div id="app"></div>
  <!-- built files will be auto injected -->

  <script src="./vendor.js"></script>
  <script>
    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
    var isLocal = window.location.hostname.indexOf('localhost') > -1;
    ga('create', 'UA-91235006-1', 'auto');
    ga('set', 'forceSSL', isLocal === true ? false : true);
  </script>
  <script>
    var _hsq = window._hsq = window._hsq || [];
    _hsq.push(['setPath', window.location.pathname]);
  </script>
  <script type="text/javascript" id="hs-script-loader" async defer src="https://js.hs-scripts.com/3894644.js"></script>
  <script async src="https://www.google-analytics.com/analytics.js"></script>
<script type="text/javascript" src="/app.js"></script></body>

</html>
"]>
[ERROR]   ConversantTest.auctionShouldRespondWithBidsFromConversant:120 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   FacebookTest.auctionShouldRespondWithBidsFromFacebook:84 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   IxTest.auctionShouldRespondWithBidsFromIx:89 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   LifestreetTest.auctionShouldRespondWithBidsFromLifestreet:89 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   PubmaticTest.auctionShouldRespondWithBidsFromPubmatic:88 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   PulsepointTest.auctionShouldRespondWithBidsFromPulsepoint:84 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR]   SovrnTest.auctionShouldRespondWithBidsFromSovrn:100 expected:<"no-cache, no-store, must-revalidate"> but was:<null>
[ERROR] Errors: 
[ERROR]   AdkernelAdnTest.openrtb2AuctionShouldRespondWithBidsFromAdkerneladn:70 » JSON ...
[ERROR]   AdtelligentTest.openrtb2AuctionShouldRespondWithBidsFromAdtelligent:56 » JSON ...
[ERROR]   ApplicationTest.ampShouldReturnTargeting:228 » JSON Unparsable JSON string: <!...
[ERROR]   ApplicationTest.biddersParamsShouldReturnBidderSchemas:568 » JSON Unparsable J...
[ERROR]   ApplicationTest.cookieSyncShouldReturnBidderStatusWithExpectedUsersyncInfo:460 » JsonParse
[ERROR]   ApplicationTest.getuidsShouldReturnJsonWithUids:535 » JSON Unparsable JSON str...
[ERROR]   ApplicationTest.infoBiddersShouldReturnRegisteredBidderNames:582 » JSON Unpars...
[ERROR]   ApplicationTest.openrtb2AuctionShouldRespondWithBidsFromAdform:126 » JSON Unpa...
[ERROR]   ApplicationTest.openrtb2AuctionShouldRespondWithBidsFromRubiconAndAppnexus:186 » JSON
[ERROR]   ApplicationTest.setuidShouldUpdateRubiconUidInUidCookie:507 NullPointer
[ERROR]   ApplicationTest.shouldAskExchangeWithUpdatedSettingsFromCache:644 » JSON Unpar...
[ERROR]   BeachfrontTest.openrtb2AuctionShouldRespondWithBidsFromBeachfront:58 » JSON Un...
[ERROR]   BrightrollTest.openrtb2AuctionShouldRespondWithBidsFromBrightroll:62 » JSON Un...
[ERROR]   ConsumableTest.openrtb2AuctionShouldRespondWithBidsFromConsumable:69 » JSON Un...
[ERROR]   ConversantTest.openrtb2AuctionShouldRespondWithBidsFromConversant:57 » JSON Un...
[ERROR]   ConversantTest.openrtb2AuctionShouldRespondWithBidsFromConversantAlias:91 » JSON
[ERROR]   EplanningTest.openrtb2AuctionShouldRespondWithBidsFromEplanning:65 » JSON Unpa...
[ERROR]   FacebookTest.openrtb2AuctionShouldRespondWithBidsFromFacebook:55 » JSON Unpars...
[ERROR]   GamoshiTest.openrtb2AuctionShouldRespondWithBidsFromGamoshi:61 » JSON Unparsab...
[ERROR]   GridTest.openrtb2AuctionShouldRespondWithBidsFromTheMediaGrid:52 » JSON Unpars...
[ERROR]   GungumTest.openrtb2AuctionShouldRespondWithBidsFromGumGum:52 » JSON Unparsable...
[ERROR]   IxTest.openrtb2AuctionShouldRespondWithBidsFromIx:60 » JSON Unparsable JSON st...
[ERROR]   LifestreetTest.openrtb2AuctionShouldRespondWithBidsFromLifestreet:60 » JSON Un...
[ERROR]   OpenxTest.openrtb2AuctionShouldRespondWithBidsFromOpenx:64 » JSON Unparsable J...
[ERROR]   PubmaticTest.openrtb2AuctionShouldRespondWithBidsFromPubmatic:59 » JSON Unpars...
[ERROR]   PulsepointTest.openrtb2AuctionShouldRespondWithBidsFromPulsepoint:55 » JSON Un...
[ERROR]   RhythmoneTest.openrtb2AuctionShouldRespondWithBidsFromRhythmone:55 » JSON Unpa...
[ERROR]   SomoaudienceTest.openrtb2AuctionShouldRespondWithBidsFromSomoaudience:94 » JSON
[ERROR]   SonobiTest.openrtb2AuctionShouldRespondWithBidsFromSonobi:57 » JSON Unparsable...
[ERROR]   SovrnTest.openrtb2AuctionShouldRespondWithBidsFromSovrn:64 » JSON Unparsable J...
[ERROR]   TtxTest.openrtb2AuctionShouldRespondWithBidsFrom33Across:52 » JSON Unparsable ...
[ERROR]   YieldmoTest.openrtb2AuctionShouldRespondWithBidsFromYieldmo:52 » JSON Unparsab...
[INFO] 
[ERROR] Tests run: 1847, Failures: 15, Errors: 32, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.177 s
[INFO] Finished at: 2019-04-16T15:32:31-07:00
[INFO] Final Memory: 35M/633M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project prebid-server: There are test failures.
[ERROR] 

Edit: It looks like I am only getting these errors locally, not in our CI/CD. I am thinking maybe my laptop can't handle the parallelization?

rpanchyk commented 5 years ago

Yeah, it's definitely something with your local env. Verified on mine - master branch is just fine.

[INFO] Tests run: 1847, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ prebid-server ---
[INFO] Building jar: /home/rpanchuk/tmp/prebid-server-java/target/prebid-server.jar
[INFO] 
[INFO] --- spring-boot-maven-plugin:2.1.1.RELEASE:repackage (default) @ prebid-server ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min
[INFO] Finished at: 2019-04-17T13:07:43+03:00
[INFO] Final Memory: 82M/1589M

My env:

Java:

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Maven:

Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T10:58:13+03:00)
Maven home: /home/<user>/opt/apache-maven-3.5.2
Java version: 1.8.0_201, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-47-generic", arch: "amd64", family: "unix"
vinnybod commented 5 years ago

Thanks, I updated my JDK and it worked. I was on 1.8.0_171, updated to the latest from adoptopendjk (202) and everything worked out.