Changeset 2452


Ignore:
Timestamp:
15/03/2009 22:45:45 (3 years ago)
Author:
chris
Message:

Fix race condition where bbackupd would run just before test finished
waiting for its 90 second error timeout on slow machines, e.g.
FreeBSD VM, causing bbackupd test to fail.

File:
1 edited

Legend:

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

    r2427 r2452  
    26192619                        "testfiles/0_2/backup/01234567/info.rf") == 0); 
    26202620 
     2621                int store_fixed_time = time(NULL); 
     2622 
    26212623                // Check that we DO get errors on compare (cannot do this 
    26222624                // until after we fix the store, which creates a race) 
     
    26332635                        "notifyran.backup-start.wait-snapshot.1")); 
    26342636 
    2635                 // Set a tag for the notify script to distinguist from 
     2637                // Set a tag for the notify script to distinguish from 
    26362638                // previous runs. 
    26372639                { 
     
    26432645                } 
    26442646 
    2645                 // bbackupd should pause for about 90 seconds 
    2646                 wait_for_backup_operation(85); 
     2647                // bbackupd should pause for about 90 seconds from store_fixed_time, 
     2648                // so check that it hasn't run after 85 seconds from store_fixed_time 
     2649                wait_for_backup_operation(85 - time(NULL) + store_fixed_time); 
    26472650                TEST_THAT(!TestFileExists("testfiles/" 
    26482651                        "notifyran.backup-start.wait-snapshot.1")); 
     
    27142717                        "testfiles/0_2/backup/01234567/info.rf") == 0); 
    27152718 
     2719                store_fixed_time = time(NULL); 
     2720 
    27162721                // Check that we DO get errors on compare (cannot do this 
    27172722                // until after we fix the store, which creates a race) 
     
    27382743                } 
    27392744 
    2740                 // bbackupd should pause for at least 90 seconds 
    2741                 wait_for_backup_operation(85); 
     2745                // bbackupd should pause for about 90 seconds from store_fixed_time, 
     2746                // so check that it hasn't run after 85 seconds from store_fixed_time 
     2747                wait_for_backup_operation(85 - time(NULL) + store_fixed_time); 
    27422748                TEST_THAT(!TestFileExists("testfiles/" 
    27432749                        "notifyran.backup-start.wait-automatic.1")); 
Note: See TracChangeset for help on using the changeset viewer.