Skip to content

Commit

Permalink
Try to fix test that fails only in the pipeline O.o
Browse files Browse the repository at this point in the history
Signed-off-by: Diogo Barbosa <[email protected]>
  • Loading branch information
dbarbosapn committed Aug 26, 2024
1 parent 77419b5 commit 67721e0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,8 @@ class RedisProxyWithExternalAuthIntegrationTest : public Event::TestUsingSimulat
}

void initialize() override {
simTime().setSystemTime(std::chrono::seconds(0));

config_helper_.addConfigModifier([&](envoy::config::bootstrap::v3::Bootstrap& bootstrap) {
auto fake_auth_cluster = config_helper_.buildStaticCluster(
"fake_auth", 0, Network::Test::getLoopbackAddressString(ipVersion()));
Expand Down Expand Up @@ -1573,7 +1575,7 @@ TEST_P(RedisProxyWithExternalAuthIntegrationTest, ErrorsUntilCorrectPasswordSent
proxyRequestStep(makeBulkStringArray({"auth", "somepassword"}), redis_client);
FakeStreamPtr auth_request2;
expectExternalAuthRequest(fake_upstream_external_auth, auth_request2, "somepassword", true);
auto expiration_time = timeSystem().systemTime() + std::chrono::seconds(5);
auto expiration_time = timeSystem().systemTime() + std::chrono::hours(1);
sendExternalAuthResponse(
auth_request2, true,
duration_cast<std::chrono::seconds>(expiration_time.time_since_epoch()).count());
Expand All @@ -1584,7 +1586,7 @@ TEST_P(RedisProxyWithExternalAuthIntegrationTest, ErrorsUntilCorrectPasswordSent
redis_client, fake_upstream_redis_connection, "", "");

// Expiration passes
timeSystem().advanceTimeWait(std::chrono::seconds(6));
timeSystem().advanceTimeWait(std::chrono::hours(2));

// Sending a command after expiration should return NOAUTH error.
proxyResponseStep(makeBulkStringArray({"get", "foo"}), "-NOAUTH Authentication required.\r\n",
Expand Down

0 comments on commit 67721e0

Please sign in to comment.