You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] SQL CLI integration test flaky failure due to Gradle incremental compilation race condition #5335
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.
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 Localworking-directory: sql-cli/remote/sqlrun: | ./gradlew publishToMavenLocal -x test -x integTest ./gradlew clean
Activity
Fix SQL CLI integration test flaky failure (opensearch-project#5335)