Skip to content

Commit

Permalink
Fix intermittent test failure in change 2246984
Browse files Browse the repository at this point in the history
Sometimes the call to copyfile does not change the mtime on
the destination file, which causes the call to Reload to
be skipped. Force the reload to avoid this issue.

See #1852

(Internal change: 2247029)
  • Loading branch information
sunyab authored and pixar-oss committed Aug 30, 2022
1 parent 41e510c commit a78eb44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pxr/usd/usd/testenv/testUsdFileFormats.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ def test_ReloadReplaceUsdUsdaWithUsdc(self):
'usda')

shutil.copyfile('crate.usd', 'test_replace.usd')
self.assertTrue(layer.Reload())

# Force a reload, otherwise the reload is skipped sometimes due
# to file mtimes not changing after copyfile.
self.assertTrue(layer.Reload(force=True))

self.assertEqual(
Usd.UsdFileFormat.GetUnderlyingFormatForLayer(layer),
'usdc')
Expand Down

0 comments on commit a78eb44

Please sign in to comment.