Skip to content

Commit

Permalink
tests: remove excessive time.sleep usage from tests.py
Browse files Browse the repository at this point in the history
There is a cumulative 12 minutes worth of time.sleep in this test
seemingly for no good reason.
  • Loading branch information
EchterAgo committed Oct 11, 2023
1 parent e3b329c commit 11f3f33
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions contrib/windows/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

# from pprint import pprint

import time

# import json

import logging
Expand Down Expand Up @@ -204,86 +202,71 @@ def main():

preTest()
ret = runWithPrint(["zpool", "create", "-f", "test01", tounc(f1)])
time.sleep(10)
if ret.returncode != 0:
print("FAIL")
print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "test01"])
time.sleep(10)
postTest()

preTest()
ret = runWithPrint(["zpool", "create", "-f", "test02", tounc(f1),
tounc(f2)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)
print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "test02"])
time.sleep(10)
postTest()

preTest()
ret = runWithPrint(["zpool", "create", "-f", "test03", tounc(f1),
tounc(f2), tounc(f3)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)
print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "test03"])
time.sleep(10)
postTest()

preTest()
ret = runWithPrint(["zpool", "create", "-f", "test04", "mirror",
tounc(f1), tounc(f2)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)
print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "test04"])
time.sleep(10)
postTest()

preTest()
ret = runWithPrint(["zpool", "create", "-f", "test05", "mirror",
tounc(f1), tounc(f2), tounc(f3)])
time.sleep(10)
if ret.returncode != 0:
print("FAIL")
print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "test05"])
time.sleep(10)
postTest()

preTest()
ret = runWithPrint(["zpool", "create", "-f", "test06", "raidz",
tounc(f1), tounc(f2), tounc(f3)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)
print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "test06"])
time.sleep(10)
postTest()

preTest()
ret = runWithPrint(["zpool", "create", "-f", "test07", "raidz1",
tounc(f1), tounc(f2), tounc(f3)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)
print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "test07"])
time.sleep(10)
postTest()

preTest("snapshot no hang:")

ret = runWithPrint(["zpool", "create", "-f", "testsn01", tounc(f1)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)
print("Drive letters after pool create:", get_driveletters())

f = PureWindowsPath(get_driveletters()[0][1], "test01.file")
Expand All @@ -299,19 +282,16 @@ def main():
ret = runWithPrint(["zpool", "export", "-a"])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)

runWithPrint(["zpool", "destroy", "-f", "testsn01"])

time.sleep(10)
postTest()

# preTest("snapshot hang")
#
# ret = runWithPrint(["zpool", "create", "-f", "testsn02", tounc(f1)])
# if ret.returncode != 0:
# print("FAIL")
# time.sleep(10)
# print("Drive letters after pool create:", get_driveletters())
#
# f = PureWindowsPath(get_driveletters()[0][1], "test01.file")
Expand All @@ -333,10 +313,8 @@ def main():
# ret = runWithPrint(["zpool", "export", "-a"])
# if ret.returncode != 0:
# print("FAIL")
# time.sleep(10)
#
# runWithPrint(["zpool", "destroy", "-f", "testsn02"])
# time.sleep(10)
# postTest()

preTest("regex for key file")
Expand All @@ -357,7 +335,6 @@ def main():
"tank", tounc(f1)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)
print("Drive letters after pool create:", get_driveletters())

ret = runWithPrint(["zfs", "get", "keylocation", "tank"])
Expand All @@ -367,7 +344,6 @@ def main():
ret = runWithPrint(["zpool", "export", "tank"])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)

print("Drive letters before pool create:", get_driveletters())
ret = runWithPrint(["zpool", "import", "-f", "-l", "-O",
Expand All @@ -376,11 +352,9 @@ def main():
tounc(f1)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)

print("Drive letters after pool create:", get_driveletters())
runWithPrint(["zpool", "destroy", "-f", "tank"])
time.sleep(10)
postTest()

preTest("run out of drive letters")
Expand All @@ -390,7 +364,6 @@ def main():
tounc(f1)])
if ret.returncode != 0:
print("FAIL")
time.sleep(10)

print("Drive letters after pool create:", get_driveletters())

Expand All @@ -401,7 +374,6 @@ def main():
print("FAIL")

runWithPrint(["zpool", "destroy", "-f", "tank" + str(i)])
time.sleep(10)

postTest()

Expand Down

0 comments on commit 11f3f33

Please sign in to comment.