Merge branch 'fix-flaky-test' into 'master'

update: change assert to fix flaky tests

See merge request fdroid/fdroidserver!1671
This commit is contained in:
Hans-Christoph Steiner 2025-06-23 19:03:27 +00:00
commit 336d5381ae

View File

@ -1406,9 +1406,7 @@ class UpdateTest(unittest.TestCase):
with self.assertLogs(level=logging.DEBUG): # suppress log output with self.assertLogs(level=logging.DEBUG): # suppress log output
fdroidserver.update._strip_and_copy_image(in_file, out_file) fdroidserver.update._strip_and_copy_image(in_file, out_file)
self.assertNotEqual(size, os.path.getsize(out_file)) self.assertNotEqual(size, os.path.getsize(out_file))
self.assertNotAlmostEqual( self.assertTrue(os.path.getctime(in_file) <= os.path.getctime(out_file))
os.path.getctime(in_file), os.path.getctime(out_file), delta=delta
)
# _strip_and_copy_image syncs mtime from in_file to out_file # _strip_and_copy_image syncs mtime from in_file to out_file
self.assertAlmostEqual( self.assertAlmostEqual(
os.path.getmtime(in_file), os.path.getmtime(out_file), delta=delta os.path.getmtime(in_file), os.path.getmtime(out_file), delta=delta