forked from bwatkinson/xdd
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with dryrun option that caused hanging (#30)
Fixed an issue with the dryrun option that would cause xdd to hang whenever the option was enabled. The issue lied in src/client/results_manager.c, as it was stuck waiting in a barrier for the other threads to also enter the barrier, which they would never do as the other threads have already exited. Also added a test to ensure that the dryrun option functions correctly. Signed-off-by: MigeljanImeri <ImeriMigel@gmail.com> Co-authored-by: MigeljanImeri <ImeriMigel@gmail.com>
- Loading branch information
1 parent
68b1f22
commit 2c62315
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |