Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 7 additions & 2 deletions hadoop-ozone/dev-support/checks/junit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ 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"
if [[ $i -eq 1 ]]; then
mvn ${MAVEN_OPTIONS} -Dmaven-surefire-plugin.argLineAccessArgs="${OZONE_MODULE_ACCESS_ARGS}" "$@" verify \
| tee "${REPORT_DIR}/output.log"
else
mvn ${MAVEN_OPTIONS} -Dmaven-surefire-plugin.argLineAccessArgs="${OZONE_MODULE_ACCESS_ARGS}" "$@" clean verify \
| tee "${REPORT_DIR}/output.log"
fi

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 think this should be done unconditionally.

  • Project may be already built if OZONE_REPO_CACHED == false, in that case even first iteration can run into the error.
  • If project is not yet built, clean does not make much difference.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we need to replace target with a different name. If the module isn't specified, the target directory will get deleted.

I noticed this issue in the following workflow run:
https://github.com/peterxcli/ozone/actions/runs/15413751760/job/43371703642#step:6:20

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.

You are right, clean will remove $REPORT_DIR. We should clean separately, before the verify step.

@peterxcli peterxcli Jun 3, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The _post_process.sh script collect the result form the target dir too, if previous result is cleaned then we might ignore some error.

I think we can use another directory to collect the test result: 0cf95b3

@peterxcli peterxcli Jun 3, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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