Touch watchdog during object cleanup in max_concurrent tests
authorPyry Haulos <phaulos@google.com>
Thu, 28 Apr 2016 10:08:42 +0000 (03:08 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 28 Apr 2016 10:08:42 +0000 (03:08 -0700)
Destroying objects can be slow on certain implementations and may lead
to watchdog timeouts.

Bug: 28436275
Bug: 28052337
Change-Id: I831062dca7caffc3761750a1a2ce7b21b53be9e9

external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp

index 43139c8..111dcb0 100644 (file)
@@ -2119,6 +2119,16 @@ tcu::TestStatus createMaxConcurrentTest (Context& context, typename Object::Para
                        context.getTestContext().touchWatchdog();
        }
 
+       // Destroy objects one by one and touch watchdog periodically as
+       // cleaning up resources is very costly on certain implementations.
+       for (deUint32 ndx = 0; ndx < numObjects; ndx++)
+       {
+               objects[ndx].clear();
+
+               if ((ndx > 0) && ((ndx % watchdogInterval) == 0))
+                       context.getTestContext().touchWatchdog();
+       }
+
        objects.clear();
 
        return tcu::TestStatus::pass("Ok");