update: change assert to fix flaky tests

This was happening often:

```
======================================================================
FAIL: test_strip_and_copy_image_in_file_ctime_changed (tests.test_update.UpdateTest.test_strip_and_copy_image_in_file_ctime_changed)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builds/fdroid/fdroidserver/tests/test_update.py", line 1409, in test_strip_and_copy_image_in_file_ctime_changed
    self.assertNotAlmostEqual(
AssertionError: 1750683024.4857466 == 1750683024.4957466 within 0.01 delta (0.009999990463256836 difference)
```
This commit is contained in:
Hans-Christoph Steiner 2025-06-23 15:16:21 +02:00
parent 61777e273c
commit 63298ad2ad

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