Fix uts on 3.2 (#13090)

This commit is contained in:
Albumen Kevin 2023-09-21 14:07:14 +08:00 committed by GitHub
parent 767eaa8ba7
commit 705d96e9f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 23 deletions

View File

@ -134,7 +134,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 8, 11, 17, 19, 21 ]
jdk: [ 8, 11, 17, 21 ]
env:
DISABLE_FILE_SYSTEM_TEST: true
steps:
@ -142,8 +142,9 @@ jobs:
with:
ref: "3.2"
- name: "Set up JDK ${{ matrix.jdk }}"
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- uses: actions/cache@v3
name: "Cache local Maven repository"
@ -180,7 +181,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 8, 11, 17, 19, 21 ]
jdk: [ 8, 11, 17, 21 ]
env:
DISABLE_FILE_SYSTEM_TEST: true
DUBBO_DEFAULT_SERIALIZATION: fastjson2
@ -190,8 +191,9 @@ jobs:
with:
ref: "3.2"
- name: "Set up JDK ${{ matrix.jdk }}"
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- uses: actions/cache@v3
name: "Cache local Maven repository"
@ -209,13 +211,21 @@ jobs:
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
restore-keys: |
zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests on JDK 8"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk == '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Test with Maven without Integration Tests on JDK 8"
timeout-minutes: 90
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk == '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') }}
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk != '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Test with Maven without Integration Tests"
timeout-minutes: 90
if: ${{ startsWith( matrix.os, 'windows') }}
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk != '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,jdk15ge-simple,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
@ -249,7 +259,7 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [ 8, 11, 17, 19, 21 ]
jdk: [ 8, 11, 17, 21 ]
job_id: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v3
@ -278,8 +288,9 @@ jobs:
name: test-list
path: test/jobs/
- name: "Set up JDK ${{matrix.jdk}}"
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{matrix.jdk}}
- name: "Init Candidate Versions"
run: |
@ -306,7 +317,7 @@ jobs:
JAVA_VER: ${{matrix.jdk}}
strategy:
matrix:
jdk: [ 8, 11, 17, 19, 21 ]
jdk: [ 8, 11, 17, 21 ]
steps:
- uses: actions/checkout@v3
with:
@ -335,8 +346,9 @@ jobs:
path: "./dubbo-test-tools"
- name: "Set up JDK 17"
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: "Compile Dubbo (Linux)"

View File

@ -64,7 +64,7 @@ jobs:
run: 7z a ${{ github.workspace }}/checkstyle.zip *checkstyle* -r
- name: "Upload checkstyle file if failure"
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: "checkstyle-file"
path: ${{ github.workspace }}/checkstyle.zip
@ -132,7 +132,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 21 ]
env:
DISABLE_FILE_SYSTEM_TEST: true
steps:
@ -150,6 +150,14 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
id: "cache-zookeeper"
with:
path: ${{ github.workspace }}/.tmp/zookeeper
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
restore-keys: |
zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') }}
@ -169,7 +177,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 21 ]
env:
DISABLE_FILE_SYSTEM_TEST: true
DUBBO_DEFAULT_SERIALIZATION: fastjson2
@ -189,14 +197,30 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
id: "cache-zookeeper"
with:
path: ${{ github.workspace }}/.tmp/zookeeper
key: zookeeper-${{ runner.os }}-${{ env.ZOOKEEPER_VERSION }}
restore-keys: |
zookeeper-${{ runner.os }}-
- name: "Test with Maven with Integration Tests on JDK 8"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk == '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Test with Maven without Integration Tests on JDK 8"
timeout-minutes: 90
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk == '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
- name: "Test with Maven with Integration Tests"
timeout-minutes: 70
if: ${{ startsWith( matrix.os, 'ubuntu') }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
if: ${{ startsWith( matrix.os, 'ubuntu') && matrix.jdk != '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge' -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Test with Maven without Integration Tests"
timeout-minutes: 90
if: ${{ startsWith( matrix.os, 'windows') }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -Pjacoco -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
if: ${{ startsWith( matrix.os, 'windows') && matrix.jdk != '8' }}
run: ./mvnw --batch-mode --no-snapshot-updates -e --no-transfer-progress --fail-fast clean test verify -P"jacoco,jdk15ge-simple,'!jdk15ge'" -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"checkstyle_unix.skip=true" -D"rat.skip=false" -D"maven.javadoc.skip=true" -D"embeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
@ -229,7 +253,7 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 21 ]
job_id: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v3
@ -286,7 +310,7 @@ jobs:
JAVA_VER: ${{matrix.jdk}}
strategy:
matrix:
jdk: [ 8, 11, 17, 19 ]
jdk: [ 8, 11, 17, 21 ]
steps:
- uses: actions/checkout@v3
with:
@ -333,7 +357,7 @@ jobs:
- name: "Upload error code inspection result"
# always() should not be used here, since we don't need to handle the 'canceled' situation.
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: "error-inspection-result"
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
@ -343,6 +367,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: "3.2"
path: "./dubbo"
- name: "Setup GraalVM environment"

View File

@ -26,7 +26,7 @@
<dubbo:metadata-report address="zookeeper://127.0.0.1:2181"/>
<dubbo:registry id="demo1" address="zookeeper://127.0.0.1:2181?registry-type=service"/>
<dubbo:registry id="demo1" address="zookeeper://127.0.0.1:2181"/>
<!-- refer with dubbo protocol-->
<dubbo:reference version="1.0.0" group="Group1" id="dubbo-demoServiceV1" check="false" scope="remote"

View File

@ -18,6 +18,7 @@
package org.apache.dubbo.metrics.aggregate;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import java.util.concurrent.atomic.LongAdder;
@ -40,7 +41,7 @@ class SlidingWindowTest {
window = new TestSlidingWindow(paneCount, intervalInMs);
}
@Test
@RepeatedTest(1000)
void testCurrentPane() {
assertNull(window.currentPane(/* invalid time*/-1L));
long timeInMs = System.currentTimeMillis();
@ -48,7 +49,7 @@ class SlidingWindowTest {
assertNotNull(currentPane);
// reuse test
assertEquals(currentPane,
window.currentPane(1 + timeInMs + window.getPaneIntervalInMs() * paneCount));
window.currentPane(timeInMs + window.getPaneIntervalInMs() * paneCount));
}
@Test