Skip to content

Commit

Permalink
Add flaky test to test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Sep 24, 2024
1 parent e72ef2a commit a6d9e8f
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
import static org.hamcrest.Matchers.nullValue;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

import jakarta.ws.rs.core.MediaType;

import org.apache.http.HttpStatus;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

Expand All @@ -18,6 +23,7 @@
@QuarkusScenario
public class HttpMinimumReactiveIT {

private static final String fileName = "FLAKY";
private RequestSpecification HTTP_CLIENT_SPEC = given();

@Test
Expand All @@ -28,7 +34,14 @@ public void httpServer() {

@Test
@Tag("QUARKUS-2893")
public void pathParamNameWithDash() {
public void pathParamNameWithDash() throws IOException {
// FIXME: remove this, I am just playing to understand flakiness reportng
var filePath = Path.of("target").resolve(fileName);
if (!Files.exists(filePath)) {
filePath.toFile().createNewFile();
Assertions.fail("failing to test flakiness reporting");
}

givenSpec().get("/api/hello/foo/AAAA").then().statusCode(HttpStatus.SC_NO_CONTENT);
givenSpec().get("/api/hello/foo/AXY9").then().statusCode(HttpStatus.SC_NO_CONTENT);
givenSpec().get("/api/hello/foo/ABCDFG").then().statusCode(HttpStatus.SC_NOT_FOUND);
Expand Down

0 comments on commit a6d9e8f

Please sign in to comment.