Changeset 2510 for box/trunk/test


Ignore:
Timestamp:
26/04/2009 15:39:21 (3 years ago)
Author:
chris
Message:

Log while sleeping in test/bbackupd.

Only show warning about diff test time taken if it's out of bounds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/test/bbackupd/testbbackupd.cpp

    r2506 r2510  
    24442444                        // 5 seconds (normally about 3 seconds) 
    24452445 
    2446                         safe_sleep(1); // 2 seconds before 
     2446                        wait_for_operation(1, "2 seconds before next run"); 
    24472447                        TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR  
    24482448                                "syncallowscript.notifyran.1", &st) != 0); 
    2449                         safe_sleep(4); // 2 seconds after 
     2449                        wait_for_operation(4, "2 seconds after run"); 
    24502450                        TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR  
    24512451                                "syncallowscript.notifyran.1", &st) == 0); 
     
    24562456                        // 10 seconds (normally about 8 seconds) 
    24572457 
    2458                         safe_sleep(6); // 2 seconds before 
     2458                        wait_for_operation(6, "2 seconds before next run"); 
    24592459                        TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR  
    24602460                                "syncallowscript.notifyran.2", &st) != 0); 
    2461                         safe_sleep(4); // 2 seconds after 
     2461                        wait_for_operation(4, "2 seconds after run"); 
    24622462                        TEST_THAT(stat("testfiles" DIRECTORY_SEPARATOR  
    24632463                                "syncallowscript.notifyran.2", &st) == 0); 
     
    24822482 
    24832483                        long wait_time = end_time - start_time + 2; 
     2484 
    24842485                        // should be about 10 seconds 
    2485                         printf("Waited for %ld seconds, should have been %s", 
    2486                                 wait_time, control_string); 
     2486                        if (wait_time < 8 || wait_time > 12) 
     2487                        { 
     2488                                printf("Waited for %ld seconds, should have " 
     2489                                        "been %s", wait_time, control_string); 
     2490                        } 
     2491 
    24872492                        TEST_THAT(wait_time >= 8); 
    24882493                        TEST_THAT(wait_time <= 12); 
Note: See TracChangeset for help on using the changeset viewer.