Skip to content

Commit a6111c6

Browse files
committed
uncomment TestServiceTest.testUpdateLabelsOnRuns
1 parent f8d0622 commit a6111c6

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

horreum-backend/src/test/java/io/hyperfoil/tools/horreum/svc/TestServiceTest.java

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import io.hyperfoil.tools.horreum.mapper.VariableMapper;
3737
import io.hyperfoil.tools.horreum.server.CloseMe;
3838
import io.hyperfoil.tools.horreum.test.*;
39+
import io.quarkus.logging.Log;
3940
import io.quarkus.test.common.QuarkusTestResource;
4041
import io.quarkus.test.junit.QuarkusTest;
4142
import io.quarkus.test.junit.TestProfile;
@@ -678,7 +679,7 @@ void testUpdateLabelsOnRuns() throws IOException, InterruptedException {
678679
assertNotNull(updates.poll(20, TimeUnit.SECONDS));
679680
}
680681

681-
System.out.println("Number of LabelValues: " + LabelValueDAO.count());
682+
Log.info("Number of LabelValues: " + LabelValueDAO.count());
682683
assertEquals(currentNumberOfLabelValues + 2200, LabelValueDAO.count());
683684

684685
OptionalInt maxId;
@@ -695,23 +696,17 @@ void testUpdateLabelsOnRuns() throws IOException, InterruptedException {
695696
for (int i = 0; i < 200; i++) {
696697
assertNotNull(updates.poll(20, TimeUnit.SECONDS));
697698
}
698-
System.out.println("Number of LabelValues after 1 label update: " + LabelValueDAO.count());
699-
/*
700-
* try (Stream<DataPointDAO> datapoints = DataPointDAO.findAll().stream()) {
701-
* maxId = datapoints.mapToInt(n -> n.id).max();
702-
* }
703-
*
704-
* //lets update 11 labels
705-
* updatedLabels = jsonRequest().body(labels2).put("/api/schema/" + schemaId2 + "/labels")
706-
* .then().statusCode(200).extract().body().jsonPath().getList(".", Integer.class);
707-
* assertEquals(11, updatedLabels.size());
708-
*
709-
* Thread.sleep(2000);
710-
* int oldMaxId = maxId.getAsInt();
711-
* try (Stream<DataPointDAO> datapoints = DataPointDAO.findAll().stream()) {
712-
* maxId = datapoints.mapToInt(n -> n.id).max();
713-
* }
714-
* assertEquals(oldMaxId + 80, maxId.getAsInt());
715-
*/
699+
700+
Log.info("Number of LabelValues after 1 label update: " + LabelValueDAO.count());
701+
maxId = DataPointDAO.<DataPointDAO> streamAll().mapToInt(dp -> dp.id).max();
702+
703+
//lets update 11 labels
704+
updatedLabels = jsonRequest().body(labels2).put("/api/schema/" + schemaId2 + "/labels")
705+
.then().statusCode(200).extract().body().jsonPath().getList(".", Integer.class);
706+
assertEquals(11, updatedLabels.size());
707+
708+
Log.info("Waiting after labels update");
709+
Thread.sleep(15 * 1000);
710+
assertEquals(maxId.getAsInt() + 800, DataPointDAO.<DataPointDAO> streamAll().mapToInt(dp -> dp.id).max().getAsInt());
716711
}
717712
}

0 commit comments

Comments
 (0)