From 190c3f0f68fd5d486c1ff2946615a9407d34aead Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Mon, 28 Oct 2024 17:34:22 +0100 Subject: [PATCH 1/2] test: try and improve flaky tests --- .../java/io/supertokens/test/oauth/api/OAuthAPIHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java b/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java index fa490d564..97c0486b4 100644 --- a/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java +++ b/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java @@ -41,6 +41,10 @@ public static void resetOAuthProvider() { + client.getAsJsonObject().get("client_id").getAsString(), new HashMap<>(), new HashMap<>(), new JsonObject()); } + + // We query these in an effort to help with possible warm up issues + HttpRequestForOAuthProvider.doGet("http://localhost:4444/.well-known/openid-configuration", new HashMap<>(), new HashMap<>()); + HttpRequestForOAuthProvider.doGet("http://localhost:4444/.well-known/jwks.json", new HashMap<>(), new HashMap<>()); } catch (Exception e) { throw new RuntimeException(e); } From 072cb48c7133941daadbafcefd3cb781dfb7306f Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Mon, 28 Oct 2024 17:37:30 +0100 Subject: [PATCH 2/2] test: try and improve flaky tests --- src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java b/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java index 97c0486b4..1ae491eab 100644 --- a/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java +++ b/src/test/java/io/supertokens/test/oauth/api/OAuthAPIHelper.java @@ -45,6 +45,7 @@ public static void resetOAuthProvider() { // We query these in an effort to help with possible warm up issues HttpRequestForOAuthProvider.doGet("http://localhost:4444/.well-known/openid-configuration", new HashMap<>(), new HashMap<>()); HttpRequestForOAuthProvider.doGet("http://localhost:4444/.well-known/jwks.json", new HashMap<>(), new HashMap<>()); + Thread.sleep(1000); } catch (Exception e) { throw new RuntimeException(e); }