• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1AUTHOR="Vladimir Samarskiy <vsamarsk@google.com>"
2NAME="Uptime Test"
3TIME="MEDIUM"  ## ~3hrs
4TEST_CLASS="Kernel"
5TEST_CATEGORY="Stress"
6TEST_TYPE="CLIENT"
7
8DOC = """
9The test repeatedly executes kernbench during T=cycle_length seconds and then
10sleeps for the same amount of time. Itterations continued
11until total elapsed time of the test reaches T=target_time
12"""
13
14import time
15
16
17def uptime_test(cycle_length = 300, target_time = 3*60*60):
18    test_started = time.time()
19    counter = 0
20    while time.time() < test_started + target_time:
21        kernbench_started = time.time()
22        while time.time() < kernbench_started + cycle_length:
23                counter += 1
24                job.run_test('kernbench', tag='%d' % counter)
25        job.run_test('sleeptest', tag='%d' % counter, seconds=cycle_length)
26
27
28uptime_test()
29
30