Fix gitlab ci timeout: do not run dockers inside docker

Change-Id: Ic8db923424f920ece37df71c063efca1339c25e1
diff --git a/app/build.gradle b/app/build.gradle
index 42fadbd..93819ce 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -19,6 +19,7 @@
     
     // Enable parallel test execution for faster builds
     maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
+    systemProperty 'korapxmltool.test', 'true'
 }
 
 dependencies {
diff --git a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
index 85255d4..a2ee6a2 100644
--- a/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
+++ b/app/src/main/kotlin/de/ids_mannheim/korapxmltools/KorapXmlTool.kt
@@ -659,6 +659,10 @@
         LogManager.getLogManager().reset()
         handler.formatter = ColoredFormatter()
 
+        if (System.getProperty("korapxmltool.test") == "true") {
+            quiet = true
+        }
+
         for (handler in LOGGER.handlers) {
             LOGGER.removeHandler(handler)
         }
@@ -1155,6 +1159,7 @@
             }
         )
         // For Krill output, use work-stealing scheduler for optimal core utilization
+        try {
         if (outputFormat == OutputFormat.KRILL) {
             workStealingSchedulerActive = true
             allFoundriesSubmitted = false
@@ -1394,6 +1399,7 @@
             }
         }
 
+        } finally {
         // Signal work-stealing scheduler that all foundries have been submitted
         if (workStealingSchedulerActive) {
             allFoundriesSubmitted = true
@@ -1402,6 +1408,7 @@
 
         // Shutdown entry executor BEFORE closing worker pool to ensure no more tasks enqueue output after EOF
         entryExecutor?.shutdown()
+        compressionExecutor?.shutdownNow()
         try {
             if (entryExecutor != null) {
                 val terminated = entryExecutor!!.awaitTermination(7, java.util.concurrent.TimeUnit.DAYS)
@@ -1602,6 +1609,7 @@
             }
         }
     }
+    }
 
     private fun processZipsWithQueue(zips: Array<String>, foundry: String, parallelism: Int) {
         // For Krill output with work-stealing, use interleaved submission by text ID
diff --git a/app/src/test/kotlin/de/ids_mannheim/korapxmltools/FoundryOverrideTest.kt b/app/src/test/kotlin/de/ids_mannheim/korapxmltools/FoundryOverrideTest.kt
index 8e1f1d9..65efc10 100644
--- a/app/src/test/kotlin/de/ids_mannheim/korapxmltools/FoundryOverrideTest.kt
+++ b/app/src/test/kotlin/de/ids_mannheim/korapxmltools/FoundryOverrideTest.kt
@@ -38,6 +38,10 @@
 
     @Test
     fun testFoundryOverrideWithTagger() {
+        val isRunningInDocker = File("/.dockerenv").exists() || 
+            (File("/proc/1/cgroup").exists() && File("/proc/1/cgroup").readText().contains("docker"))
+        org.junit.Assume.assumeFalse("Skipping Docker test inside Docker container", isRunningInDocker)
+
         val outputDir = File.createTempFile("foundry_override_test", "").apply {
             delete()
             mkdirs()