Commit d258ca04 by Stanislav Chiknavaryan Committed by Commit Bot

Fix EGLSyncControlTest.SyncValuesTest timeout on Windowse Server 2012 R2

The test does two buffer swaps and polls sync values waiting for sbc (swap buffer counter) value to first increase from 0 to 1, then from 1 to 2. Looking the error log I see that sometimes it fails on the first wait and sometimes on the second wait. Also the total runtime varies between 1000 and 1600 ms. That makes me think that perhaps test doesn't poll long enough to run reliably on a test machine. I've increased the number of poll iteration to 500 and the sleep between iterations - to 10 ms (I think in reality it was 10 ms already because the previously used 1 ms is only possible with high resolution system timer). BUG=angleproject:1402 Change-Id: I8f6fe209756a1597e2739390352c90d893eaf940 Reviewed-on: https://chromium-review.googlesource.com/395506Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent e61d3045
...@@ -190,6 +190,9 @@ class EGLSyncControlTest : public testing::Test ...@@ -190,6 +190,9 @@ class EGLSyncControlTest : public testing::Test
// can be called on DX11 with direct composition and that it returns reasonable enough values. // can be called on DX11 with direct composition and that it returns reasonable enough values.
TEST_F(EGLSyncControlTest, SyncValuesTest) TEST_F(EGLSyncControlTest, SyncValuesTest)
{ {
static const DWORD kPollInterval = 10;
static const int kNumPollIterations = 500;
if (!mD3D11Available) if (!mD3D11Available)
{ {
std::cout << "D3D11 not available, skipping test" << std::endl; std::cout << "D3D11 not available, skipping test" << std::endl;
...@@ -229,9 +232,9 @@ TEST_F(EGLSyncControlTest, SyncValuesTest) ...@@ -229,9 +232,9 @@ TEST_F(EGLSyncControlTest, SyncValuesTest)
ASSERT_EGL_TRUE(eglSwapBuffers(mDisplay, mSurface)); ASSERT_EGL_TRUE(eglSwapBuffers(mDisplay, mSurface));
// Poll until sbc value increases. Normally it should change within 16-17 ms. // Poll until sbc value increases. Normally it should change within 16-17 ms.
for (int i = 0; i < 100; i++) for (int i = 0; i < kNumPollIterations; i++)
{ {
::Sleep(1); ::Sleep(kPollInterval);
ASSERT_EGL_TRUE(eglGetSyncValuesCHROMIUM(mDisplay, mSurface, &ust, &msc, &sbc)); ASSERT_EGL_TRUE(eglGetSyncValuesCHROMIUM(mDisplay, mSurface, &ust, &msc, &sbc));
if (sbc > 0) if (sbc > 0)
break; break;
...@@ -251,9 +254,9 @@ TEST_F(EGLSyncControlTest, SyncValuesTest) ...@@ -251,9 +254,9 @@ TEST_F(EGLSyncControlTest, SyncValuesTest)
// Poll until sbc value increases. Normally it should change within 16-17 ms. // Poll until sbc value increases. Normally it should change within 16-17 ms.
EGLuint64KHR ust2 = 0, msc2 = 0, sbc2 = 0; EGLuint64KHR ust2 = 0, msc2 = 0, sbc2 = 0;
for (int i = 0; i < 100; i++) for (int i = 0; i < kNumPollIterations; i++)
{ {
::Sleep(1); ::Sleep(kPollInterval);
ASSERT_EGL_TRUE(eglGetSyncValuesCHROMIUM(mDisplay, mSurface, &ust2, &msc2, &sbc2)); ASSERT_EGL_TRUE(eglGetSyncValuesCHROMIUM(mDisplay, mSurface, &ust2, &msc2, &sbc2));
if (sbc2 > sbc) if (sbc2 > sbc)
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment