From b5d7ab9610696c7c9031be15315658eabcde7323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Sat, 14 Jan 2017 19:50:23 +0000 Subject: [PATCH] Remove racy check that relies on mtime changing between writes. --- NEWS | 5 +++++ dulwich/tests/test_index.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 193913396..46dc58bed 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,10 @@ 0.16.3 UNRELEASED + TEST FIXES + + * Remove racy check that relies on clock time changing between writes. + (Jelmer Vernooij) + 0.16.2 2016-01-14 IMPROVEMENTS diff --git a/dulwich/tests/test_index.py b/dulwich/tests/test_index.py index b25d29b1f..24f6e4b26 100644 --- a/dulwich/tests/test_index.py +++ b/dulwich/tests/test_index.py @@ -405,7 +405,8 @@ def test_norewrite(self): build_index_from_tree(repo.path, repo.index_path(), repo.object_store, tree.id) sync() - self.assertNotEqual(mtime, os.stat(filea_path).st_mtime) + with open(filea_path, 'rb') as fh: + self.assertEqual(b'file a', fh.read()) @skipIf(not getattr(os, 'symlink', None), 'Requires symlink support')