diff --git a/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc b/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc index 172e85cf094..912a5dae6a3 100644 --- a/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc +++ b/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc @@ -88,6 +88,9 @@ SCENARIO("Testing NextHopConsistentHash class, using policy 'consistent_hash'", // THEN("when making requests and taking nodes down.") { + REQUIRE(nhf.strategies_loaded == true); + REQUIRE(strategy != nullptr); + // first request. br(&request, "rabbit.net"); result.reset(); @@ -217,6 +220,9 @@ SCENARIO("Testing NextHopConsistentHash class (all firstcalls), using policy 'co THEN("when making requests and taking nodes down.") { + REQUIRE(nhf.strategies_loaded == true); + REQUIRE(strategy != nullptr); + // first request. br(&request, "rabbit.net"); result.reset(); @@ -311,6 +317,9 @@ SCENARIO("Testing NextHopConsistentHash class (alternating rings), using policy THEN("expect the following results when making requests and marking hosts down.") { + REQUIRE(nhf.strategies_loaded == true); + REQUIRE(strategy != nullptr); + // first request. br(&request, "bunny.net/asset1"); result.reset(); diff --git a/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc b/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc index 104efc0f09e..7df2fd3735f 100644 --- a/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc +++ b/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc @@ -62,6 +62,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'rr-strict'", "[NextHopR THEN("then testing rr-strict.") { + REQUIRE(nhf.strategies_loaded == true); + REQUIRE(strategy != nullptr); + // first request. ParentResult result; strategy->findNextHop(10000, result, rdata, fail_threshold, retry_time); @@ -164,6 +167,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'first-live'", "[NextHop THEN("when making requests and marking down hosts.") { + REQUIRE(nhf.strategies_loaded == true); + REQUIRE(strategy != nullptr); + // first request. ParentResult result; strategy->findNextHop(20000, result, rdata, fail_threshold, retry_time); @@ -226,6 +232,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'rr-ip'", "[NextHopRound THEN("when making requests and marking down hosts.") { + REQUIRE(nhf.strategies_loaded == true); + REQUIRE(strategy != nullptr); + // first request. memcpy(&rdata.client_ip, &sa1, sizeof(sa1)); ParentResult result; @@ -278,6 +287,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'latched'", "[NextHopRou THEN("when making requests and marking down hosts.") { + REQUIRE(nhf.strategies_loaded == true); + REQUIRE(strategy != nullptr); + // first request should select p3 ParentResult result; strategy->findNextHop(40000, result, rdata, fail_threshold, retry_time);