mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
test: state: sleep 1 sec to simulate realistic behavior
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import stat
|
||||
import time
|
||||
|
||||
from dvc.system import System
|
||||
from dvc.state import State, StateEntry
|
||||
@@ -24,6 +25,13 @@ class TestState(TestDvc):
|
||||
self.assertEqual(entry.mtime, mtime)
|
||||
self.assertEqual(entry.inode, inode)
|
||||
|
||||
# Sleep some time to simulate realistic behavior.
|
||||
# Some filesystems have a bad date resolution for
|
||||
# mtime(i.e. 1sec for HFS) that cause problems with
|
||||
# our 'state' system not being able to distinguish
|
||||
# files that were modified within that delta.
|
||||
time.sleep(1)
|
||||
|
||||
os.chmod(path, stat.S_IWRITE)
|
||||
os.unlink(path)
|
||||
with open(path, 'w+') as fd:
|
||||
|
||||
Reference in New Issue
Block a user