Changeset 1922


Ignore:
Timestamp:
04/11/2007 21:38:58 (4 years ago)
Author:
chris
Message:

Add some sleeps to ensure that timestamps change enough to invalidate
the directory cache in the store on filesystem with low timestamp
resolution (e.g. OSX).

File:
1 edited

Legend:

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

    r1494 r1922  
    12121212                        TEST_THAT(dir.GetAttributes() == attr); 
    12131213                } 
     1214 
    12141215                // Check that we don't get attributes if we don't ask for them 
    12151216                { 
     
    12251226                        TEST_THAT(!dir.HasAttributes()); 
    12261227                } 
     1228 
     1229                // sleep to ensure that the timestamp on the file will change 
     1230                ::safe_sleep(1); 
     1231 
    12271232                // Change attributes on the directory 
    12281233                { 
     
    12631268                        TEST_THAT(rep->GetObjectID() == uploads[UPLOAD_FILE_TO_MOVE].allocated_objid); 
    12641269                } 
     1270 
    12651271                // Try some dodgy renames 
    12661272                { 
     
    12751281                                ConnectionException, Conn_Protocol_UnexpectedReply); 
    12761282                } 
     1283 
     1284                // sleep to ensure that the timestamp on the file will change 
     1285                ::safe_sleep(1); 
     1286 
    12771287                // Rename within a directory 
    12781288                { 
     
    12821292                                subdirid, BackupProtocolClientMoveObject::Flags_MoveAllWithSameName, newName); 
    12831293                } 
     1294 
    12841295                // Check it's all gone from the root directory... 
    12851296                { 
     
    13011312                        } 
    13021313                } 
     1314 
    13031315                // Check the old and new versions are in the other directory 
    13041316                { 
     
    13301342                        TEST_THAT(foundOld); 
    13311343                } 
     1344 
    13321345                // make a little bit more of a thing to look at 
    13331346                int64_t subsubdirid = 0; 
     
    13531366                        subsubfileid = stored->GetObjectID(); 
    13541367                } 
     1368 
    13551369                // Query names -- test that invalid stuff returns not found OK 
    13561370                { 
     
    13701384                        TEST_THAT(nameRep->GetNumNameElements() == 0);           
    13711385                } 
     1386 
    13721387                // Query names... first, get info for the file 
    13731388                { 
     
    13871402                        } 
    13881403                } 
     1404 
    13891405                // Query names... secondly, for the directory 
    13901406                { 
     
    16861702        // First, try logging in without an account having been created... just make sure login fails. 
    16871703 
    1688         int pid = LaunchServer(BBSTORED " testfiles/bbstored.conf", 
    1689                 "testfiles/bbstored.pid"); 
     1704        std::string cmd = BBSTORED " " + bbstored_args +  
     1705                " testfiles/bbstored.conf"; 
     1706        int pid = LaunchServer(cmd.c_str(), "testfiles/bbstored.pid"); 
    16901707 
    16911708        TEST_THAT(pid != -1 && pid != 0); 
Note: See TracChangeset for help on using the changeset viewer.