From dd5d2789e201516fe363289d6a0e3829ad2258ca Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Wed, 17 Jul 2024 20:25:44 +0200 Subject: [PATCH] fix: flaky int test --- .../tests/transfer/TransferEndToEndTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java b/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java index e853b000..eef946d3 100644 --- a/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java +++ b/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java @@ -124,7 +124,20 @@ void transferData() { .statusCode(200) .extract().body().jsonPath().getString("@id"); - // fetch EDR for transfer process + await().atMost(TEST_TIMEOUT_DURATION) + .pollDelay(TEST_POLL_DELAY) + .untilAsserted(() -> { + var jp= baseRequest() + .body(emptyQueryBody) + .post(CONSUMER_MANAGEMENT_URL + "/api/management/v3/transferprocesses/request") + .then() + .statusCode(200) + .extract().body().jsonPath(); + + assertThat(jp.getString("state")).contains("STARTED"); + }); + + // fetch EDR for transfer processs var endpoint = new AtomicReference(); var token = new AtomicReference(); await().atMost(TEST_TIMEOUT_DURATION) @@ -133,6 +146,7 @@ void transferData() { var jp = baseRequest() .get(CONSUMER_MANAGEMENT_URL + "/api/management/v3/edrs/%s/dataaddress".formatted(transferProcessId)) .then() + .log().ifValidationFails() .statusCode(200) .onFailMessage("Expected to find an EDR with transfer ID %s but did not!".formatted(transferProcessId)) .extract().body().jsonPath();