From 5a071e1b19a86072f2d8dff6f25848e27d892ff7 Mon Sep 17 00:00:00 2001 From: "A.J. Beamon" Date: Sat, 30 Jul 2022 14:22:24 -0700 Subject: [PATCH] Fix bug in token cache unit test where the expiration time was underflowing. --- fdbrpc/TokenCache.actor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdbrpc/TokenCache.actor.cpp b/fdbrpc/TokenCache.actor.cpp index 574a110d53..7c6d84a8d6 100644 --- a/fdbrpc/TokenCache.actor.cpp +++ b/fdbrpc/TokenCache.actor.cpp @@ -265,7 +265,7 @@ TEST_CASE("/fdbrpc/authz/TokenCache/BadTokens") { }, { [](Arena&, IRandom& rng, authz::jwt::TokenRef& token) { - token.expiresAtUnixTime = uint64_t(g_network->timer() - 10 - rng.random01() * 50); + token.expiresAtUnixTime = uint64_t(std::max(g_network->timer() - 10 - rng.random01() * 50, 0)); }, "ExpiredToken", },