Skip to content

Commit

Permalink
ComputeNodeTest : Check that different nodes can share cache entries
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Aug 31, 2023
1 parent dbff7d6 commit e26da05
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/GafferTest/ComputeNodeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,5 +749,18 @@ def testInterleavedEditsAndComputes( self ) :
n["op1"].setValue( i )
self.assertEqual( n["sum"].getValue(), i )

def testCacheSharedBetweenNodes( self ) :

n1 = GafferTest.AddNode()
n2 = GafferTest.AddNode()

with Gaffer.PerformanceMonitor() as pm :

self.assertEqual( n1["sum"].getValue(), 0 )
self.assertEqual( n2["sum"].getValue(), 0 )

self.assertEqual( pm.plugStatistics( n1["sum"] ).computeCount, 1 )
self.assertEqual( pm.plugStatistics( n2["sum"] ).computeCount, 0 )

if __name__ == "__main__":
unittest.main()

0 comments on commit e26da05

Please sign in to comment.