Skip to content

Commit 1b1c067

Browse files
kgibalaCompute-Runtime-Automation
authored andcommitted
Test: Ensure that ioctl statistics test is deterministic
Related-To: NEO-6537 Signed-off-by: Krzysztof Gibala <[email protected]>
1 parent 91840e6 commit 1b1c067

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

opencl/test/unit_test/linux/main_linux_dll.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,17 @@ TEST_F(DrmFailedIoctlTests, givenPrintIoctlEntriesWhenCallFailedIoctlThenExpecte
256256
TEST_F(DrmSimpleTests, givenPrintIoctlTimesWhenCallIoctlThenStatisticsAreGathered) {
257257
struct DrmMock : public Drm {
258258
using Drm::ioctlStatistics;
259+
260+
int ioctl(unsigned long request, void *arg) override {
261+
auto start = std::chrono::steady_clock::now();
262+
std::chrono::steady_clock::time_point end;
263+
264+
do {
265+
end = std::chrono::steady_clock::now();
266+
} while (std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count() == 0);
267+
268+
return Drm::ioctl(request, arg);
269+
}
259270
};
260271

261272
constexpr long long initialMin = std::numeric_limits<long long>::max();

0 commit comments

Comments
 (0)