Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IECoreScene tests : Tighten up a couple test timings #1398

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ def backgroundRun():
startTime = time.time()
thread.start()

time.sleep( 0.05 )
time.sleep( 0.01 )
canceller.cancel()
thread.join()

Expand Down
3 changes: 3 additions & 0 deletions src/IECoreScene/MeshAlgoTriangulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ MeshPrimitivePtr MeshAlgo::triangulate(
throw InvalidArgumentException( "MeshAlgo::triangulate : Mesh with invalid primitive variables" );
}

// arePrimitiveVariablesValid is expensive enough that we should check the canceller after running it.
Canceller::check( canceller );

// already triangulated
if ( mesh->maxVerticesPerFace() == 3 )
{
Expand Down
4 changes: 2 additions & 2 deletions test/IECoreScene/MeshAlgoTriangulateTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,13 @@ def backgroundRun():
startTime = time.time()
thread.start()

time.sleep( 0.1 )
time.sleep( 0.01 )
canceller.cancel()
thread.join()

# This test should actually produce a time extremely close to the sleep duration ( within
# 0.01 seconds whether the sleep duration is 0.01 seconds or 1 seconds ), but checking
# that it terminates with 0.1 seconds is a minimal performance bar
# that it terminates with 0.2 seconds is a minimal performance bar
self.assertLess( time.time() - startTime, 0.2 )
self.assertTrue( cancelled[0] )

Expand Down
2 changes: 1 addition & 1 deletion test/IECoreScene/PrimitiveTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def backgroundRun():
startTime = time.time()
thread.start()

time.sleep( 0.05 )
time.sleep( 0.01 )
canceller.cancel()
thread.join()

Expand Down
Loading