test: fix "overwrite" test on mac

This commit is contained in:
Ruslan Kuprieiev
2018-12-19 15:56:33 +02:00
committed by GitHub
parent eb810e617e
commit 7ecb9e87ae
+13
View File
@@ -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',