Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with dryrun option that caused hanging #30

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions src/client/results_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ xdd_results_manager(void *data) {
xdd_init_barrier_occupant(&barrier_occupant, "RESULTS_MANAGER", (XDD_OCCUPANT_TYPE_SUPPORT), NULL);
xdd_barrier(&planp->main_general_init_barrier,&barrier_occupant,0);

if (xgp->global_options & GO_DRYRUN) {
return(0);
}

// This is the loop that runs continuously throughout the xdd run
while (1) {
// This barrier will release all the targets at the start of a pass so they all start at the same time
Expand Down
1 change: 1 addition & 0 deletions src/client/xdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ DFLOW("\n----------------------All targets should start now---------------------
// At this point all the Target threads are running and we will enter the final_barrier
// waiting for them to finish or exit if this is just a dry run
if (xgp->global_options & GO_DRYRUN) {
fprintf(xgp->output, "Run has ended due to dry run option being enabled. \n");
// Cleanup the semaphores and barriers
xdd_destroy_all_barriers(planp);
return(XDD_RETURN_VALUE_SUCCESS);
Expand Down
1 change: 1 addition & 0 deletions tests/functional/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(FUNCTIONAL
test_xdd_createnewfiles2.sh
test_xdd_dryrun.sh
test_xdd_heartbeat_byte.sh
test_xdd_heartbeat_elapsed.sh
test_xdd_heartbeat_lf.sh
Expand Down
44 changes: 44 additions & 0 deletions tests/functional/test_xdd_dryrun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
#
# Acceptance test for XDD.
#
# Validate the functionality of the -dryrun option to ensure it works as intended.
#
# Description - passes the dry run option to a simple xdd command
#
# Source the test configuration environment
#
source ../test_config
source ../common.sh

# Perform pre-test
initialize_test
test_dir="${XDDTEST_LOCAL_MOUNT}/${TESTNAME}"
log_file="$(get_log_file)"

# ReqSize 4096, Bytes 1MB, Targets 1, QueueDepth 4, Passes 1
data_file="${test_dir}/test"

# write a file
"${XDDTEST_XDD_EXE}" -op write -reqsize 4096 -mbytes 1 -targets 1 "${data_file}" -qd 4 -passes 1 -datapattern random

# now run dryrun
sleep_seconds=2
"${XDDTEST_XDD_EXE}" -op read -reqsize 1 -targets 1 "${data_file}" -dryrun &
pid=$!

# sleep for 2 seconds before checking if XDD process is still running
(
echo "xdd started, pid=${pid}"
echo "sleep ${sleep_seconds}"
) > "${log_file}"
sleep "${sleep_seconds}"

if pkill "${pid}" ; then
# test failed
echo "Had to kill ${pid}." >> "${log_file}"
finalize_test 1 "Requested -dryrun option, but XDD process was still running after ${sleep_seconds}, something is causing it to hang"
else
# test passed
finalize_test 0
fi