Date: Wed, 16 Dec 2015 21:09:58 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r292370 - in projects/zfsd/head/tests/sys/cddl/zfs/tests: history hotspare zfsd Message-ID: <201512162109.tBGL9wsg075580@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Wed Dec 16 21:09:58 2015 New Revision: 292370 URL: https://svnweb.freebsd.org/changeset/base/292370 Log: Misc ZFS test suite fixes tests/sys/cddl/zfs/tests/history/history_004_pos.ksh If this test fails, dump the history log. The last test run had this test fail for the first time in over a month, without any corresponding changes. Upon inspection, however, it is only apparent that an additional 17 events occurred than should have. It seems likely this was caused by external tools touching the pool. If so, this test will need to be made more specific. tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_004_neg.ksh Don't assert that file_trunc is still running a second later. This is racy; the process may complete successfully before then. Instead, just assert that the iteration file exists afterwards. tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib wait_for_disk_to_reappear: retry if the device node hasn't arrived. This will avoid races where this function could return before the device's corresponding /dev node has been created. Operations made against the CAM device will work, but not those that access the /dev node directly, e.g. zpool labelclear. This change should fix spurious failures from zfsd_autoreplace_002_pos et al, that appear particularly with debug kernels. Submitted by: Will Sponsored by: Spectra Logic Corp Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/history/history_004_pos.ksh projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_004_neg.ksh projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/history/history_004_pos.ksh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/history/history_004_pos.ksh Wed Dec 16 21:05:44 2015 (r292369) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/history/history_004_pos.ksh Wed Dec 16 21:09:58 2015 (r292370) @@ -58,7 +58,7 @@ verify_runnable "global" log_assert "'zpool history' can copes with many simultaneous command." -typeset -i orig_count=$($ZPOOL history $spool | $WC -l | $AWK '{print $1}') +typeset -i orig_count=$($ZPOOL history $TESTPOOL | $WC -l | $AWK '{print $1}') typeset -i i=0 while ((i < 10)); do @@ -102,11 +102,11 @@ while ((i < 10)); do ((i += 1)) done -typeset -i entry_count=$($ZPOOL history $spool | $WC -l | $AWK '{print $1}') +typeset -i count=$($ZPOOL history $TESTPOOL | $WC -l | $AWK '{print $1}') -if ((entry_count - orig_count != 200)); then - log_fail "The entries count error: entry_count=$entry_count " \ - "orig_count = $orig_count" +if ((count - orig_count != 200)); then + $ZPOOL history $spool + log_fail "Expected 200 more than $orig_count entries, but got $count" fi log_pass "zpool history copes with simultaneous commands passed." Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_004_neg.ksh ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_004_neg.ksh Wed Dec 16 21:05:44 2015 (r292369) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/hotspare/hotspare_onoffline_004_neg.ksh Wed Dec 16 21:09:58 2015 (r292370) @@ -89,11 +89,6 @@ function start_all_wp $FILE_TRUNC $options $TESTDIR/$TESTFILE.$i & typeset pid=$! - $SLEEP 1 - if ! $PS -p $pid > /dev/null 2>&1; then - log_fail "$FILE_TRUNC $options $TESTDIR/$TESTFILE.$i" - fi - child_pids="$child_pids $pid" ((i = i + 1)) done @@ -116,6 +111,7 @@ function verify_assertion # dev done kill_all_wp + log_must test -f $TESTDIR/$TESTFILE.$i log_must $ZPOOL offline $TESTPOOL $odev log_must check_state $TESTPOOL $odev "offline" Modified: projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib ============================================================================== --- projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib Wed Dec 16 21:05:44 2015 (r292369) +++ projects/zfsd/head/tests/sys/cddl/zfs/tests/zfsd/zfsd.kshlib Wed Dec 16 21:09:58 2015 (r292370) @@ -34,8 +34,8 @@ function wait_for_disk_to_reappear for ((; $timeout > 0; timeout=$timeout-1)); do find_disk_by_phy $EXPANDER $PHY - [ -n "$FOUNDDISK" ] && return - $SLEEP 3 + [ -n "$FOUNDDISK" -a -e "/dev/$FOUNDDISK" ] && return + $SLEEP 1 done log_fail "ERROR: Disk ${EXPECTED_DISK} never reappeared" }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512162109.tBGL9wsg075580>