What is the bug?
The SQL CLI integration test workflow (sql-cli-integration-test.yml) intermittently fails with a NoSuchFileException during compilation. The failure is non-deterministic — re-running the job usually passes.
Error
Execution failed for task ':sql:protocol:compileJava'.
> Compilation failed; see the compiler output below.
SimpleJsonResponseFormatter.java:47: error: cannot access ProfileContext
ProfileMetric formatMetric = QueryProfiling.current().getOrCreateMetric(MetricName.FORMAT);
^
bad class file: .../sql-cli/remote/sql/core/build/classes/java/main/org/opensearch/sql/monitor/profile/ProfileContext.class
unable to access file: java.nio.file.NoSuchFileException: .../ProfileContext.class
Root cause
The workflow has two steps:
publishToMavenLocal — builds the SQL project under sql-cli/remote/sql/, producing .class files in the build directory
./gradlew test -PuseLocalSql=true — runs sql-cli tests, but instead of resolving SQL dependencies from Maven Local jars, the sql-cli Gradle build references the SQL source project at remote/sql/ directly and re-compiles it
When Gradle performs incremental compilation in step 2, it may delete stale .class files in core/build/classes/ before recompiling them. Meanwhile, the protocol module compilation is concurrently reading those same .class files from the classpath. This race condition causes NoSuchFileException.
Re-runs pass because Gradle daemon/cache state varies between attempts — when incremental recompilation is not triggered, there is no race.
Example failures
Suggested fix
Clean the SQL build directory after publishToMavenLocal to ensure sql-cli resolves dependencies only from Maven Local jars, not from the stale build output:
- name: Build and publish SQL modules to Maven Local
working-directory: sql-cli/remote/sql
run: |
./gradlew publishToMavenLocal -x test -x integTest
./gradlew clean
What is the bug?
The SQL CLI integration test workflow (
sql-cli-integration-test.yml) intermittently fails with aNoSuchFileExceptionduring compilation. The failure is non-deterministic — re-running the job usually passes.Error
Root cause
The workflow has two steps:
publishToMavenLocal— builds the SQL project undersql-cli/remote/sql/, producing.classfiles in the build directory./gradlew test -PuseLocalSql=true— runs sql-cli tests, but instead of resolving SQL dependencies from Maven Local jars, the sql-cli Gradle build references the SQL source project atremote/sql/directly and re-compiles itWhen Gradle performs incremental compilation in step 2, it may delete stale
.classfiles incore/build/classes/before recompiling them. Meanwhile, theprotocolmodule compilation is concurrently reading those same.classfiles from the classpath. This race condition causesNoSuchFileException.Re-runs pass because Gradle daemon/cache state varies between attempts — when incremental recompilation is not triggered, there is no race.
Example failures
Suggested fix
Clean the SQL build directory after
publishToMavenLocalto ensure sql-cli resolves dependencies only from Maven Local jars, not from the stale build output: