PR#4433: fix some utils tests for newer platforms

Merges #4433
https://pagure.io/koji/pull-request/4433

Fixes: #4434
https://pagure.io/koji/issue/4434
unit tests error on F42+
This commit is contained in:
Mike McLean 2025-08-01 15:01:40 -04:00
commit 7c2d768d22
2 changed files with 13 additions and 9 deletions

View file

@ -330,7 +330,8 @@ class TasksTestCase(unittest.TestCase):
obj.session.host.taskWait.return_value = [[], [99, 100, 101]]
time.side_effect = list(range(0, 4000, 60))
if six.PY3:
sigtimedwait = patch('signal.sigtimedwait').start()
sigtimedwait = patch('signal.sigtimedwait')
sigtimedwait.start()
try:
obj.wait([99, 100, 101], timeout=3600)
@ -366,7 +367,8 @@ class TasksTestCase(unittest.TestCase):
obj.session.host.taskWait.side_effect = taskWait_returns
if six.PY3:
sigtimedwait = patch('signal.sigtimedwait').start()
sigtimedwait = patch('signal.sigtimedwait')
sigtimedwait.start()
obj.wait([99, 100, 101], timeout=3600)

View file

@ -827,7 +827,7 @@ class MavenUtilTestCase(unittest.TestCase):
# invalid month
'2000-13-32': 'month must be in 1..12',
# invalid day
'2000-12-32': 'day is out of range for month',
'2000-12-32': 'day.*',
# invalid hour
'2000-12-31 24:61:61': 'hour must be in 0..23',
# invalid minute
@ -835,7 +835,7 @@ class MavenUtilTestCase(unittest.TestCase):
# invalid second
'2000-12-31 23:59:61': 'second must be in 0..59',
# corner case, leap day
'1969-2-29': 'day is out of range for month'
'1969-2-29': 'day.*'
}
# invalid date test
@ -1924,13 +1924,9 @@ class TestRmtree2(unittest.TestCase):
sync = multiprocessing.Event()
def do_rmtree(dirname):
sync.wait()
koji.util.rmtree(dirname)
procs = []
for n in range(3):
proc = multiprocessing.Process(target=do_rmtree, args=(dirname,))
proc = multiprocessing.Process(target=sync_rmtree, args=(sync, dirname,))
proc.start()
procs.append(proc)
sync.set()
@ -1962,6 +1958,12 @@ class TestRmtree2(unittest.TestCase):
raise Exception('test directory not removed')
def sync_rmtree(sync, dirname):
"""Wait for a sync, then call rmtree"""
sync.wait()
koji.util.rmtree(dirname)
class TestProxyLogger(unittest.TestCase):
def setUp(self):