Skip to content

Commit 31ead9c

Browse files
Copilottorosent
andauthored
Fix duplicate plugin application, simplify CI to use JDK 11, and fix DTS emulator connectivity (#248)
* Initial plan * Initial plan Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Fix 'default messager has already been registered' warning - Remove duplicate plugin application in samples-azure-functions/build.gradle - Remove duplicate plugin application in endtoendtests/build.gradle - Move 'java' plugin to plugins block - Upgrade azure-functions plugin from 1.11.1 to 1.16.1 Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Revert unintended changes to orchestrator_service.proto The proto file was accidentally modified by the downloadProtoFiles task during the build. This reverts it to the original state. Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Revert plugin version to 1.11.1 to fix Gradle 7.4 compatibility The azure-functions plugin 1.16.1 brings in jackson-core 2.17.0 which contains Java 21 class files that Gradle 7.4's ASM cannot handle. Keep the duplicate plugin application removal fix which helps reduce the "default messager" warning. Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Fix SpotBugs Java version - run with JDK 11 SpotBugs 4.9.2 requires Java 11+ (class file version 55.0) but the workflow was running it with Java 8. Updated workflow to use JDK_11 environment variable for SpotBugs tasks. Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Fix SpotBugs - run build task with JDK 11 too SpotBugs runs as part of the 'build' task, not just in the explicit SpotBugs step. Updated the build step to also use JDK_11 since SpotBugs 4.9.2 requires Java 11+. Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Update all CI jobs to use JDK 11 - Updated Integration Tests to use JDK_11 - Updated functions-e2e-tests job to use JDK 11 instead of JDK 8 - Updated functions-sample-tests job to use JDK 11 instead of JDK 8 Regarding Gradle 8.0: Upgrading would require also updating the protobuf plugin from 0.8.16 to 0.9.x for full compatibility, which is a larger change that could be done in a separate PR. Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Fix DTS emulator connectivity with proper health check loop Replace fixed 10-second sleep with a robust health check that: - Actively polls port 4001 using nc until the emulator is ready - Allows up to 60 seconds for the emulator to start - Provides better error diagnostics if startup fails - Adds 5 extra seconds after port is open for gRPC initialization Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Use bash /dev/tcp for more portable health check Address code review feedback: - Replace nc with bash's /dev/tcp for portability - Rename max_attempts to MAX_WAIT_SECONDS with comment - Add comment explaining the TCP check mechanism Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> * Simplify Java setup: remove JDK 8, use only JDK 11 - Remove JDK 8 setup since it's not needed - Remove JDK_11 environment variable workaround - Remove all `export JAVA_HOME=$JDK_11` lines - Upgrade setup-java from v2 to v4 in all jobs - Workflow now uses only JDK 11 throughout Co-authored-by: torosent <17064840+torosent@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: torosent <17064840+torosent@users.noreply.github.com>
1 parent 8d927d8 commit 31ead9c

3 files changed

Lines changed: 36 additions & 31 deletions

File tree

.github/workflows/build-validation.yml

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,11 @@ jobs:
2222
- uses: actions/checkout@v2
2323

2424
- name: Set up JDK 11
25-
uses: actions/setup-java@v2
25+
uses: actions/setup-java@v4
2626
with:
2727
java-version: '11'
2828
distribution: 'microsoft'
2929

30-
- name: set JDK_11 environment variable test compiling and running
31-
env:
32-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
33-
run: echo ::set-env name=JDK_11::$(echo $JAVA_HOME)
34-
35-
- name: Set up JDK 8
36-
uses: actions/setup-java@v2
37-
with:
38-
java-version: '8'
39-
distribution: 'temurin'
40-
4130
- name: Setup Gradle
4231
uses: gradle/gradle-build-action@v2
4332

@@ -56,9 +45,7 @@ jobs:
5645
if-no-files-found: ignore
5746

5847
- name: Run Unit Tests with Gradle
59-
run: |
60-
export JAVA_HOME=$JDK_11
61-
./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
48+
run: ./gradlew clean test || echo "UNIT_TEST_FAILED=true" >> $GITHUB_ENV
6249
continue-on-error: true
6350

6451
- name: Upload test reports if tests failed
@@ -77,11 +64,31 @@ jobs:
7764
run: docker run --name durabletask-emulator -p 4001:8080 -d mcr.microsoft.com/dts/dts-emulator:latest
7865

7966
- name: Display Durable Task Emulator Logs
80-
run: nohup docker logs --since=0 durabletask-emulator > durabletask-emulator.log 2>&1 &
67+
run: nohup docker logs -f durabletask-emulator > durabletask-emulator.log 2>&1 &
8168

82-
# wait for 10 seconds, so sidecar container can be fully up, this will avoid intermittent failing issues for integration tests causing by failed to connect to sidecar
83-
- name: Wait for 10 seconds
84-
run: sleep 10
69+
- name: Wait for Durable Task Emulator to be ready
70+
run: |
71+
echo "Waiting for Durable Task Emulator to be ready on port 4001..."
72+
# Maximum wait time of 60 seconds for emulator startup
73+
MAX_WAIT_SECONDS=60
74+
attempt=0
75+
# Use bash's /dev/tcp for portability instead of nc
76+
while ! (echo > /dev/tcp/localhost/4001) 2>/dev/null; do
77+
attempt=$((attempt + 1))
78+
if [ $attempt -ge $MAX_WAIT_SECONDS ]; then
79+
echo "ERROR: Emulator not ready after $MAX_WAIT_SECONDS seconds"
80+
echo "Docker container status:"
81+
docker ps -a
82+
echo "Container logs:"
83+
docker logs durabletask-emulator 2>&1 | tail -50
84+
exit 1
85+
fi
86+
echo "Attempt $attempt/$MAX_WAIT_SECONDS - waiting for emulator..."
87+
sleep 1
88+
done
89+
echo "Durable Task Emulator is ready on port 4001"
90+
# Give additional time for gRPC service to fully initialize after port is open
91+
sleep 5
8592
8693
- name: Integration Tests with Gradle
8794
run: ./gradlew integrationTest || echo "TEST_FAILED=true" >> $GITHUB_ENV
@@ -120,11 +127,11 @@ jobs:
120127
steps:
121128
- uses: actions/checkout@v2
122129

123-
- name: Set up JDK 8
124-
uses: actions/setup-java@v2
130+
- name: Set up JDK 11
131+
uses: actions/setup-java@v4
125132
with:
126-
java-version: '8'
127-
distribution: 'temurin'
133+
java-version: '11'
134+
distribution: 'microsoft'
128135

129136
- name: Setup Gradle
130137
uses: gradle/gradle-build-action@v2
@@ -159,11 +166,11 @@ jobs:
159166
steps:
160167
- uses: actions/checkout@v2
161168

162-
- name: Set up JDK 8
163-
uses: actions/setup-java@v2
169+
- name: Set up JDK 11
170+
uses: actions/setup-java@v4
164171
with:
165-
java-version: '8'
166-
distribution: 'temurin'
172+
java-version: '11'
173+
distribution: 'microsoft'
167174

168175
- name: Setup Gradle
169176
uses: gradle/gradle-build-action@v2

endtoendtests/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
plugins {
2+
id 'java'
23
id "com.microsoft.azure.azurefunctions" version "1.11.1"
34
}
4-
apply plugin: 'java'
5-
apply plugin: "com.microsoft.azure.azurefunctions"
65

76
group 'com.durabletask.endtoend'
87
version '0.0.0-SNAPSHOT'

samples-azure-functions/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
plugins {
2+
id 'java'
23
id "com.microsoft.azure.azurefunctions" version "1.11.1"
34
}
4-
apply plugin: 'java'
5-
apply plugin: "com.microsoft.azure.azurefunctions"
65

76
group 'com.functions'
87
version '0.1.0-SNAPSHOT'

0 commit comments

Comments
 (0)