VirtualBox

Changeset 75734 in vbox


Ignore:
Timestamp:
Nov 26, 2018 2:49:51 PM (6 years ago)
Author:
vboxsync
Message:

tstRTR0Timer: Run the omni timer tests for a longer time period and allow a wider margin for the standard timers. Should allow the test to succeed most of time and let all the hires timer tests run

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstRTR0Timer.cpp

    r69111 r75734  
    822822                }
    823823
    824                 /* run it for 1 second. */
     824                /* run it for 5 seconds. */
    825825                RTCPUSET OnlineSet;
    826826                uint64_t uStartNsTS = RTTimeSystemNanoTS();
     
    828828                RTMpGetOnlineSet(&OnlineSet);
    829829
    830                 for (uint32_t i = 0; i < 5000 && RTTimeSystemNanoTS() - uStartNsTS <= UINT32_C(1000000000); i++)
     830                for (uint32_t i = 0; i < 5000 && RTTimeSystemNanoTS() - uStartNsTS <= UINT64_C(5000000000); i++)
    831831                    RTThreadSleep(2);
    832832
     
    854854                /* Check tick counts. ASSUMES no cpu on- or offlining.
    855855                   This only catches really bad stuff. */
    856                 uint32_t cMinTicks = cAvgTicks - cAvgTicks / 10;
    857                 uint32_t cMaxTicks = cAvgTicks + cAvgTicks / 10 + 1;
     856                uint32_t cMargin = TSTRTR0TIMER_IS_HIRES(uOperation) ? 10 : 5; /* Allow a wider deviation for the non hires timers. */
     857                uint32_t cMinTicks = cAvgTicks - cAvgTicks / cMargin;
     858                uint32_t cMaxTicks = cAvgTicks + cAvgTicks / cMargin + 1;
    858859                for (uint32_t iCpu = 0; iCpu < RTCPUSET_MAX_CPUS; iCpu++)
    859860                    if (paStates[iCpu].cTicks)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette