Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/intermittent-test-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ env:
RATIS_REPO: ${{ github.event.inputs.ratis-repo }}
RATIS_VERSION: ${{ github.event.inputs.ratis-ref }}
JAVA_VERSION: ${{ github.event.inputs.java-version }}
TARGET_DIR: flaky-test-target
# Surefire 3.0.0-M4 is used because newer versions do not reliably kill the fork on timeout
# SUREFIRE-1722, SUREFIRE-1815
SUREFIRE_VERSION: 3.0.0-M4
Expand Down Expand Up @@ -131,8 +132,8 @@ jobs:
- name: Find modules
id: modules
run: |
grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' target/unit/output.log | grep -B1 'Running org.apache'
modules=$(grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' target/unit/output.log | grep -B1 'Running org.apache' \
grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' ${{ env.TARGET_DIR }}/unit/output.log | grep -B1 'Running org.apache'
modules=$(grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' ${{ env.TARGET_DIR }}/unit/output.log | grep -B1 'Running org.apache' \
| grep surefire | cut -f2 -d'@' | awk '{ print $1 }' | sed 's/^/:/' | xargs | sed -e 's/ /,/g')
echo "modules=$modules" >> $GITHUB_OUTPUT
if: ${{ !cancelled() }}
Expand Down Expand Up @@ -275,14 +276,14 @@ jobs:
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Summary of failures
run: hadoop-ozone/dev-support/checks/_summary.sh target/unit/summary.txt
run: hadoop-ozone/dev-support/checks/_summary.sh ${{ env.TARGET_DIR }}/unit/summary.txt
if: ${{ !cancelled() }}
- name: Archive build results
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: result-${{ github.run_number }}-${{ github.run_id }}-split-${{ matrix.split }}
path: target/unit
path: ${{ env.TARGET_DIR }}/unit
count-failures:
if: ${{ failure() }}
needs: run-test
Expand Down
7 changes: 4 additions & 3 deletions hadoop-ozone/dev-support/checks/junit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cd "$DIR/../../.." || exit 1
: ${ITERATIONS:="1"}
: ${OZONE_WITH_COVERAGE:="false"}
: ${OZONE_REPO_CACHED:="false"}
: ${TARGET_DIR:="target"}

declare -i ITERATIONS
if [[ ${ITERATIONS} -le 0 ]]; then
Expand Down Expand Up @@ -56,7 +57,7 @@ if [[ ${ITERATIONS} -gt 1 ]] && [[ ${OZONE_REPO_CACHED} == "false" ]]; then
mvn ${MAVEN_OPTIONS} -DskipTests install
fi

REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/${CHECK}"}
REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../${TARGET_DIR}/${CHECK}"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need another variable (TARGET_DIR), flaky-test-check workflow can set OUTPUT_DIR directly.

REPORT_FILE="${REPORT_DIR}/summary.txt"
mkdir -p "$REPORT_DIR"

Expand All @@ -68,8 +69,8 @@ for i in $(seq 1 ${ITERATIONS}); do
mkdir -p "${REPORT_DIR}"
fi

mvn ${MAVEN_OPTIONS} -Dmaven-surefire-plugin.argLineAccessArgs="${OZONE_MODULE_ACCESS_ARGS}" "$@" verify \
| tee "${REPORT_DIR}/output.log"
mvn ${MAVEN_OPTIONS} -Dmaven-surefire-plugin.argLineAccessArgs="${OZONE_MODULE_ACCESS_ARGS}" "$@" clean verify \
| tee "${REPORT_DIR}/output.log"
irc=$?

# shellcheck source=hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ void testSnapshotOperationsNotBlockedDuringCompaction() throws IOException, Inte
final Semaphore compactionLock = new Semaphore(1);
final AtomicBoolean table1Compacting = new AtomicBoolean(false);
final AtomicBoolean table1CompactedFinish = new AtomicBoolean(false);
final AtomicBoolean table2CompactedFinish = new AtomicBoolean(false);
org.apache.hadoop.hdds.utils.db.DBStore store1 = snapshot1.get().getMetadataManager().getStore();
doAnswer(invocation -> {
table1Compacting.set(true);
Expand All @@ -392,6 +393,10 @@ void testSnapshotOperationsNotBlockedDuringCompaction() throws IOException, Inte
table1CompactedFinish.set(true);
return null;
}).when(store1).compactTable("table1");
doAnswer(invocation -> {
table2CompactedFinish.set(true);
return null;
}).when(store1).compactTable("table2");
compactionLock.acquire();

final UUID dbKey2 = UUID.randomUUID();
Expand All @@ -411,6 +416,7 @@ void testSnapshotOperationsNotBlockedDuringCompaction() throws IOException, Inte
assertFalse(table1CompactedFinish.get());
compactionLock.release();
GenericTestUtils.waitFor(() -> table1CompactedFinish.get(), 50, 3000);
GenericTestUtils.waitFor(() -> table2CompactedFinish.get(), 50, 3000);

verify(store1, times(1)).compactTable("table1");
verify(store1, times(1)).compactTable("table2");
Expand Down