From 16d59e825c9a21ec8fb5978fc538a661a2df7d23 Mon Sep 17 00:00:00 2001 From: Taimoor Zaeem Date: Sat, 19 Jul 2025 12:04:57 +0500 Subject: [PATCH] test: adjust jwt claims error test to avoid failure The JWT claims IO test fails too often. This breaks our workflows. This commit adjusts the edge cases in test to prevent flakiness. --- test/io/test_io.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/io/test_io.py b/test/io/test_io.py index e45a71327..29a74d28f 100644 --- a/test/io/test_io.py +++ b/test/io/test_io.py @@ -99,20 +99,20 @@ def test_jwt_errors(defaultenv): assert response.status_code == 401 assert response.json()["message"] == 'role "not_existing" does not exist' - # -31 seconds, because we allow clock skew of 30 seconds - headers = jwtauthheader({"exp": relativeSeconds(-31)}, SECRET) + # -35 seconds, because we allow clock skew of 30 seconds + headers = jwtauthheader({"exp": relativeSeconds(-35)}, SECRET) response = postgrest.session.get("/", headers=headers) assert response.status_code == 401 assert response.json()["message"] == "JWT expired" - # 31 seconds, because we allow clock skew of 30 seconds - headers = jwtauthheader({"nbf": relativeSeconds(31)}, SECRET) + # 35 seconds, because we allow clock skew of 30 seconds + headers = jwtauthheader({"nbf": relativeSeconds(35)}, SECRET) response = postgrest.session.get("/", headers=headers) assert response.status_code == 401 assert response.json()["message"] == "JWT not yet valid" - # 31 seconds, because we allow clock skew of 30 seconds - headers = jwtauthheader({"iat": relativeSeconds(31)}, SECRET) + # 35 seconds, because we allow clock skew of 35 seconds + headers = jwtauthheader({"iat": relativeSeconds(35)}, SECRET) response = postgrest.session.get("/", headers=headers) assert response.status_code == 401 assert response.json()["message"] == "JWT issued at future"