8000 [Windows] Stabilizing flaky Quarkus unit tests by Pepo48 · Pull Request #35638 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
8000
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,28 @@
import io.restassured.RestAssured;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import static io.restassured.RestAssured.given;

class KeycloakMetricsConfigurationTest {

@BeforeAll
static void setUpAll() {
System.setProperty("KC_CACHE", "local");
}

@AfterAll
static void tearDownAll() {
System.clearProperty("KC_CACHE");
}

@BeforeEach
void setUpPort() {
void setUp() {
RestAssured.port = 9001;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public void testReadinessDown() {
agroalDataSource.close();

RestAssured.port = 9001;
System.setProperty("KC_CACHE", "local"); // avoid flaky port conflicts
given()
.when().get("/health/ready")
.then()
.statusCode(503)
.body(Matchers.containsString("DOWN"));
System.clearProperty("KC_CACHE");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import io.restassured.RestAssured;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -29,8 +31,18 @@

class KeycloakPathConfigurationTest {

@BeforeAll
static void setUpAll() {
System.setProperty("KC_CACHE", "local");
}

@AfterAll
static void tearDownAll() {
System.clearProperty("KC_CACHE");
}

@BeforeEach
void setUpPort() {
void setUp() {
RestAssured.port = 9001;
}

Expand Down
ADE0
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.hamcrest.Matchers;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -29,8 +31,18 @@

public class KeycloakReadyHealthCheckTest {

@BeforeAll
static void setUpAll() {
System.setProperty("KC_CACHE", "local");
}

@AfterAll
static void tearDownAll() {
System.clearProperty("KC_CACHE");
}

@BeforeEach
void setUpPort() {
void setUp() {
RestAssured.port = 9001;
}

Expand Down
0