From 96bbbe35e15d1216b585139ae9698d2035c177fc 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 953406469..e33b1e755 100644 --- a/test/io/test_io.py +++ b/test/io/test_io.py @@ -102,20 +102,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"