mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	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:
		
							parent
							
								
									61777e273c
								
							
						
					
					
						commit
						63298ad2ad
					
				
					 1 changed files with 1 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1406,9 +1406,7 @@ class UpdateTest(unittest.TestCase):
 | 
			
		|||
        with self.assertLogs(level=logging.DEBUG):  # suppress log output
 | 
			
		||||
            fdroidserver.update._strip_and_copy_image(in_file, out_file)
 | 
			
		||||
        self.assertNotEqual(size, os.path.getsize(out_file))
 | 
			
		||||
        self.assertNotAlmostEqual(
 | 
			
		||||
            os.path.getctime(in_file), os.path.getctime(out_file), delta=delta
 | 
			
		||||
        )
 | 
			
		||||
        self.assertTrue(os.path.getctime(in_file) <= os.path.getctime(out_file))
 | 
			
		||||
        # _strip_and_copy_image syncs mtime from in_file to out_file
 | 
			
		||||
        self.assertAlmostEqual(
 | 
			
		||||
            os.path.getmtime(in_file), os.path.getmtime(out_file), delta=delta
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue