Changeset 2083 for box/trunk/test


Ignore:
Timestamp:
31/01/2008 23:53:27 (4 years ago)
Author:
chris
Message:

Add a sleep after every access to the read-only connection, to ensure that
subsequent changes in the other connection get a new whole-second timestamp
and hopefully fix test failures reported by Alex Harper on MacOS X.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/test/backupstore/testbackupstore.cpp

    r1922 r2083  
    975975                test_server_1(protocol, protocolReadOnly); 
    976976 
     977                // sleep to ensure that the timestamp on the file will change 
     978                ::safe_sleep(1); 
     979 
    977980                // Create and upload some test files 
    978981                int64_t maxID = 0; 
     
    10491052 
    10501053                        // Use the read only connection to verify that the directory is as we expect 
     1054                        printf("\n\n==== Reading directory using read-only connection\n"); 
    10511055                        check_dir_after_uploads(protocolReadOnly, attrtest); 
     1056                        printf("done.\n\n"); 
    10521057                        // And on the read/write one 
    10531058                        check_dir_after_uploads(protocol, attrtest); 
    10541059                } 
    10551060                 
     1061                // sleep to ensure that the timestamp on the file will change 
     1062                ::safe_sleep(1); 
     1063 
    10561064                // Check diffing and rsync like stuff... 
    10571065                // Build a modified file 
     
    11501158                        subdirfileid = stored->GetObjectID(); 
    11511159                } 
     1160 
     1161                printf("\n==== Checking upload using read-only connection\n"); 
    11521162                // Check the directories on the read only connection 
    11531163                { 
     
    11821192                        TEST_THAT(en->GetModificationTime() == 0);      // dirs don't have modification times. 
    11831193                } 
     1194 
    11841195                { 
    11851196                        // Command 
     
    12121223                        TEST_THAT(dir.GetAttributes() == attr); 
    12131224                } 
     1225                printf("done.\n\n"); 
    12141226 
    12151227                // Check that we don't get attributes if we don't ask for them 
     
    12591271                } 
    12601272                 
     1273                // sleep to ensure that the timestamp on the file will change 
     1274                ::safe_sleep(1); 
     1275 
    12611276                // Test moving a file 
    12621277                { 
     
    12811296                                ConnectionException, Conn_Protocol_UnexpectedReply); 
    12821297                } 
    1283  
    1284                 // sleep to ensure that the timestamp on the file will change 
    1285                 ::safe_sleep(1); 
    12861298 
    12871299                // Rename within a directory 
     
    13421354                        TEST_THAT(foundOld); 
    13431355                } 
     1356 
     1357                // sleep to ensure that the timestamp on the file will change 
     1358                ::safe_sleep(1); 
    13441359 
    13451360                // make a little bit more of a thing to look at 
Note: See TracChangeset for help on using the changeset viewer.