From 74807a54822b3fe03fa6763b0b0f4c039dc64d68 Mon Sep 17 00:00:00 2001 From: Pavol Mederly Date: Sat, 23 May 2020 23:34:52 +0200 Subject: [PATCH] Fix TestStrings.test222FormApproveByCheese The test was not deterministic and failed on faster machines. --- .../com/evolveum/midpoint/testing/story/TestStrings.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java index 39ca236134c..161e62699af 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java @@ -1061,7 +1061,9 @@ public void test222FormApproveByCheese() throws Exception { // audit displayDumpable("audit", dummyAuditService); List records = dummyAuditService.getRecords(); - assertEquals("Wrong # of audit records", 4, records.size()); + if (records.size() != 4 && records.size() != 5) { + fail("Wrong # of audit records: " + records.size() + " (expected 4 or 5)"); + } AuditEventRecord record = records.get(0); Collection> deltas = record.getDeltas(); assertEquals("Wrong # of deltas in audit record", 1, deltas.size()); @@ -1075,6 +1077,7 @@ public void test222FormApproveByCheese() throws Exception { // record #1, #2: cancellation of work items of other approvers // record #3: finishing process execution + // optional #4: asynchronous execution in task CaseType rootCase = getCase(aCase.getParentRef().getOid()); waitForCaseClose(rootCase, CASE_WAIT_TIMEOUT);