mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 07:18:27 +01:00
test: fix "overwrite" test on mac
This commit is contained in:
@@ -332,6 +332,13 @@ class TestRunUnprotectOutsHardlink(TestDvc):
|
||||
|
||||
class TestCmdRunOverwrite(TestDvc):
|
||||
def test(self):
|
||||
# NOTE: using sleep() is a workaround for filesystems
|
||||
# with low mtime resolution. We have to use mtime since
|
||||
# comparing mtime's is the only way to check that the stage
|
||||
# file didn't change(size and inode in the first test down
|
||||
# below don't change).
|
||||
import time
|
||||
|
||||
ret = main(['run',
|
||||
'-d', self.FOO,
|
||||
'-d', self.CODE,
|
||||
@@ -342,6 +349,8 @@ class TestCmdRunOverwrite(TestDvc):
|
||||
|
||||
stage_mtime = os.path.getmtime('out.dvc')
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
ret = main(['run',
|
||||
'-d', self.FOO,
|
||||
'-d', self.CODE,
|
||||
@@ -354,6 +363,8 @@ class TestCmdRunOverwrite(TestDvc):
|
||||
self.assertEqual(stage_mtime, os.path.getmtime('out.dvc'))
|
||||
stage_mtime = os.path.getmtime('out.dvc')
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
ret = main(['run',
|
||||
'-d', self.FOO,
|
||||
'-d', self.CODE,
|
||||
@@ -368,6 +379,8 @@ class TestCmdRunOverwrite(TestDvc):
|
||||
self.assertNotEqual(stage_mtime, os.path.getmtime('out.dvc'))
|
||||
stage_mtime = os.path.getmtime('out.dvc')
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
ret = main(['run',
|
||||
'--overwrite-dvcfile',
|
||||
'-f', 'out.dvc',
|
||||
|
||||
Reference in New Issue
Block a user