fix: Fix test stability issues

This commit is contained in:
Ilkka Seppälä committed 2026-06-07 12:10:39 +03:00
1 parent 13cde46f2e
commit 177dc52704
24 files changed
+253 -111

No files matched your search

@@ -67,7 +67,12 @@ public class SingleTableInheritance implements CommandLineRunner {
* @param args program runtime arguments
*/
public static void main(String[] args) {
SpringApplication.run(SingleTableInheritance.class, args);
var context = SpringApplication.run(SingleTableInheritance.class, args);
if (args.length > 0 && "test".equals(args[0])) {
// Close the context immediately during tests to prevent Tomcat/background threads from
// hanging the JVM
context.close();
}
}
/**
@@ -33,6 +33,6 @@ class SingleTableInheritanceTest {
@Test
void shouldExecuteWithoutException() {
assertDoesNotThrow(() -> SingleTableInheritance.main(new String[] {}));
assertDoesNotThrow(() -> SingleTableInheritance.main(new String[] {"test"}));
}
}