Skip to content

🔴 P0: Gradle test process exits with code 1 despite all tests passing - blocks JaCoCo #26

@bedaHovorka

Description

@bedaHovorka

Bug Description

Severity: 🔴 CRITICAL (P0 - BLOCKER)
Component: Build system (build.gradle.kts)
Discovered: 2026-01-10 during test coverage expansion (Phases 4-6)

Gradle test executor exits with code 1 despite all 591 tests passing (587 passed, 4 skipped, 0 failed). This blocks JaCoCo coverage report generation and causes CI/CD false failures.

Reproduction

./gradlew test
# Output shows: Test Results: SUCCESS (591 tests, 587 passed, 4 skipped, 0 failed)
# But then: FAILURE: Build failed with an exception
# Error: Process 'Gradle Test Executor' finished with non-zero exit value 1

Impact

Root Cause Hypothesis

  1. Test process configuration issue (not test correctness - all tests pass)
  2. Possibly related to JUnit static @nested class warnings:
    • DefaultContextTest
    • InOutWorkerTest
    • ShuntingLoopTest
    • DoubletonTest
  3. Possibly test process timeout/memory settings
  4. Possibly Gradle test listener configuration

Investigation Steps

# 1. Get detailed stack trace
./gradlew test --stacktrace

# 2. Check test process logs
cat build/test-results/test/*.xml

# 3. Run with detailed logging
./gradlew test --info 2>&1 | tee test-debug.log

# 4. Check for specific test causing issue
./gradlew test --tests MainArgumentParsingTest --info

Potential Fixes

// In build.gradle.kts
tasks.test {
    // Option 1: Increase test process memory
    maxHeapSize = "512m"

    // Option 2: Adjust fork settings
    maxParallelForks = 4
    forkEvery = 100

    // Option 3: Adjust failure handling
    ignoreFailures = false
    failFast = false

    // Option 4: Enhance logging
    testLogging {
        events("passed", "skipped", "failed", "standardOut", "standardError")
        showStackTraces = true
        showExceptions = true
    }
}

Related Issues

Estimated Fix Time

1-2 hours

References

  • BUGS_FOUND.md - BUG-001
  • Branch: copilot/increase-test-coverage

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions