From 5fb6fa16b7b6c12b2c7cebe1542566cb1cfb27f0 Mon Sep 17 00:00:00 2001 From: Geert Bevin Date: Sat, 30 Sep 2023 19:20:02 -0400 Subject: [PATCH] Some test timing tweaks to try to work around CI failures. --- .../bld/operations/TestCreateRife2Operation.java | 15 +++++++++------ .../rife/bld/operations/TestUberJarOperation.java | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/test/java/rife/bld/operations/TestCreateRife2Operation.java b/src/test/java/rife/bld/operations/TestCreateRife2Operation.java index 6aad8cd..fbe2073 100644 --- a/src/test/java/rife/bld/operations/TestCreateRife2Operation.java +++ b/src/test/java/rife/bld/operations/TestCreateRife2Operation.java @@ -292,9 +292,10 @@ public class TestCreateRife2Operation { } catch (FileUtilsErrorException e) { throw new RuntimeException(e); } - }, 1, TimeUnit.SECONDS); - executor.schedule(() -> run_operation.process().destroy(), 2, TimeUnit.SECONDS); + }, 2, TimeUnit.SECONDS); + executor.schedule(() -> run_operation.process().destroy(), 4, TimeUnit.SECONDS); assertThrows(ExitStatusException.class, run_operation::execute); + Thread.sleep(1000); assertTrue(check_result.toString().contains("

Hello World Myapp

")); } finally { @@ -542,9 +543,10 @@ public class TestCreateRife2Operation { } catch (FileUtilsErrorException e) { throw new RuntimeException(e); } - }, 1, TimeUnit.SECONDS); - executor.schedule(() -> run_operation.process().destroy(), 2, TimeUnit.SECONDS); + }, 2, TimeUnit.SECONDS); + executor.schedule(() -> run_operation.process().destroy(), 4, TimeUnit.SECONDS); assertThrows(ExitStatusException.class, run_operation::execute); + Thread.sleep(1000); assertTrue(check_result.toString().contains("

Hello World Myapp

"), check_result.toString()); } finally { @@ -708,9 +710,10 @@ public class TestCreateRife2Operation { } catch (FileUtilsErrorException e) { throw new RuntimeException(e); } - }, 1, TimeUnit.SECONDS); - executor.schedule(() -> run_operation.process().destroy(), 2, TimeUnit.SECONDS); + }, 2, TimeUnit.SECONDS); + executor.schedule(() -> run_operation.process().destroy(), 4, TimeUnit.SECONDS); assertThrows(ExitStatusException.class, run_operation::execute); + Thread.sleep(1000); assertTrue(check_result.toString().contains("

Hello World Myapp

")); } finally { diff --git a/src/test/java/rife/bld/operations/TestUberJarOperation.java b/src/test/java/rife/bld/operations/TestUberJarOperation.java index 1a022a0..dafce6f 100644 --- a/src/test/java/rife/bld/operations/TestUberJarOperation.java +++ b/src/test/java/rife/bld/operations/TestUberJarOperation.java @@ -170,9 +170,10 @@ public class TestUberJarOperation { } catch (FileUtilsErrorException e) { throw new RuntimeException(e); } - }, 1, TimeUnit.SECONDS); - executor.schedule(() -> run_operation.process().destroy(), 2, TimeUnit.SECONDS); + }, 2, TimeUnit.SECONDS); + executor.schedule(() -> run_operation.process().destroy(), 4, TimeUnit.SECONDS); assertThrows(ExitStatusException.class, run_operation::execute); + Thread.sleep(1000); assertTrue(check_result.toString().contains("

Hello World App

")); } finally {