Skip to content

TestRandomKeyGenerator#ALL[ratis-3.1.0-rc-verify]-1x1 #247

TestRandomKeyGenerator#ALL[ratis-3.1.0-rc-verify]-1x1

TestRandomKeyGenerator#ALL[ratis-3.1.0-rc-verify]-1x1 #247

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: flaky-test-check
on:
workflow_dispatch:
inputs:
ref:
description: Git Ref (Branch/Commit_ID/Tag)
default: master
required: true
test-class:
description: Test Class
default: NA
required: true
test-name:
description: Test Name
default: ALL
required: false
iterations:
description: Number of Iterations per split
default: 10
required: true
splits:
description: Number of splits
default: 10
required: true
fail-fast:
description: Stop after first failure
default: false
required: true
ratis-repo:
description: Ratis repository
default: ''
required: false
ratis-ref:
description: Ratis ref (branch, tag or commit SHA)
default: ''
required: false
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
TEST_CLASS: ${{ github.event.inputs.test-class}}
TEST_METHOD: ${{ github.event.inputs.test-name }}
ITERATIONS: ${{ github.event.inputs.iterations }}
FAIL_FAST: ${{ github.event.inputs.fail-fast }}
RATIS_REPO: ${{ github.event.inputs.ratis-repo }}
RATIS_VERSION: ${{ github.event.inputs.ratis-ref }}
run-name: ${{ github.event_name == 'workflow_dispatch' && format('{0}#{1}[{2}]-{3}x{4}', inputs.test-class, inputs.test-name, inputs.ref, inputs.splits, inputs.iterations) || '' }}
jobs:
prepare-job:
runs-on: ubuntu-20.04
outputs:
matrix: ${{steps.generate.outputs.matrix}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- id: generate
name: Generate test matrix
run: |
splits=()
for ((i = 1; i <= ${{ github.event.inputs.splits }}; i++)); do
splits+=("$i")
done
printf -v x "%s," "${splits[@]}"
split_matrix="[${x%,}]"
echo "matrix=$split_matrix" >> $GITHUB_OUTPUT
ratis:
uses: ./.github/workflows/build-ratis.yml
if: ${{ github.event.inputs.ratis-ref != '' }}
with:
repo: ${{ github.event.inputs.ratis-repo || format('{0}/ratis', github.repository_owner) }}
ref: ${{ github.event.inputs.ratis-ref }}
build:
if: ${{ always() }}
needs:
- prepare-job
- ratis
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Cache for maven dependencies
uses: actions/cache/restore@v4
with:
path: |
~/.m2/repository/*/*/*
!~/.m2/repository/org/apache/ozone
key: maven-repo-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-repo-
- name: Download Ratis repo
if: ${{ github.event.inputs.ratis-ref != '' }}
uses: actions/download-artifact@v4
with:
name: ratis-jars
path: |
~/.m2/repository/org/apache/ratis
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
- name: Build (most) of Ozone
run: |
args="-Dskip.npx -Dskip.installnpx -DskipShade"
if [[ "${{ github.event.inputs.ratis-ref }}" != "" ]]; then
args="$args -Dratis.version=${{ needs.ratis.outputs.ratis-version }}"
args="$args -Dratis.thirdparty.version=${{ needs.ratis.outputs.thirdparty-version }}"
args="$args -Dio.grpc.version=${{ needs.ratis.outputs.grpc-version }}"
args="$args -Dnetty.version=${{ needs.ratis.outputs.netty-version }}"
args="$args -Dgrpc.protobuf-compile.version=${{ needs.ratis.outputs.protobuf-version }}"
fi
hadoop-ozone/dev-support/checks/build.sh $args
- name: Store Maven repo for tests
uses: actions/upload-artifact@v4
with:
name: ozone-repo
path: |
~/.m2/repository/org/apache/ozone
retention-days: 1
run-test:
if: ${{ always() }}
needs:
- prepare-job
- ratis
- build
name: Run-Split
runs-on: ubuntu-20.04
strategy:
matrix:
split: ${{fromJson(needs.prepare-job.outputs.matrix)}} # Define splits
fail-fast: ${{ fromJson(github.event.inputs.fail-fast) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
- name: Cache for maven dependencies
uses: actions/cache/restore@v4
with:
path: |
~/.m2/repository/*/*/*
!~/.m2/repository/org/apache/ozone
key: maven-repo-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-repo-
- name: Download Ratis repo
if: ${{ github.event.inputs.ratis-ref != '' }}
uses: actions/download-artifact@v4
with:
name: ratis-jars
path: |
~/.m2/repository/org/apache/ratis
- name: Download Ozone repo
id: download-ozone-repo
uses: actions/download-artifact@v4
with:
name: ozone-repo
path: |
~/.m2/repository/org/apache/ozone
continue-on-error: true
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
- name: Execute tests
run: |
if [[ -e "${{ steps.download-ozone-repo.outputs.download-path }}" ]]; then
export OZONE_REPO_CACHED=true
fi
args="-DexcludedGroups=native|slow|unhealthy"
if [[ "${{ github.event.inputs.ratis-ref }}" != "" ]]; then
args="$args -Dratis.version=${{ needs.ratis.outputs.ratis-version }}"
args="$args -Dratis.thirdparty.version=${{ needs.ratis.outputs.thirdparty-version }}"
args="$args -Dio.grpc.version=${{ needs.ratis.outputs.grpc-version }}"
args="$args -Dnetty.version=${{ needs.ratis.outputs.netty-version }}"
args="$args -Dgrpc.protobuf-compile.version=${{ needs.ratis.outputs.protobuf-version }}"
fi
if [ "$TEST_METHOD" = "ALL" ]; then
echo "Running all tests from $TEST_CLASS"
set -x
hadoop-ozone/dev-support/checks/junit.sh $args -Dtest="$TEST_CLASS,Abstract*Test*\$*"
else
echo "Running test: $TEST_METHOD from $TEST_CLASS"
set -x
hadoop-ozone/dev-support/checks/junit.sh $args -Dtest="$TEST_CLASS#$TEST_METHOD,Abstract*Test*\$*"
fi
continue-on-error: true
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
- name: Summary of failures
run: hadoop-ozone/dev-support/checks/_summary.sh target/unit/summary.txt
if: ${{ !cancelled() }}
- name: Archive build results
uses: actions/upload-artifact@v4
if: always()
with:
name: result-${{ github.run_number }}-${{ github.run_id }}-split-${{ matrix.split }}
path: target/unit
count-failures:
if: ${{ always() }}
needs: run-test
runs-on: ubuntu-20.04
steps:
- name: Download build results
uses: actions/download-artifact@v4
- name: Count failures
run: |
failures=$(find . -name 'summary.txt' | grep -v 'iteration' | xargs grep -v 'exit code: 0' | wc -l)
echo "Total failures: $failures"
if [[ $failures -gt 0 ]]; then
echo ""
echo "Failed runs:"
grep 'exit code: 1' */summary.txt | grep -o 'split.*teration [0-9]*' | sed -e 's/.summary.txt:/ /' -e 's/-/ /' | sort -g -k2 -k4
echo ""
exit 1
fi