Skip to content

Commit

Permalink
[XrdEcTests] Use different directory name for each test
Browse files Browse the repository at this point in the history
This is necessary to avoid test failures when running tests in
parallel, as they'd be trying to overwrite each other's data in
that case, and also failing tests do not clean up after themselves,
so the following tests all fail if a given test fails.
  • Loading branch information
amadio committed Jun 19, 2023
1 parent 1ae4579 commit 552bdb0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/XrdEcTests/MicroTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,10 @@ void MicroTest::Init( bool usecrc32c )
objcfg.reset( new ObjCfg( "test.txt", nbdata, nbparity, chsize, usecrc32c, true ) );
rawdata.clear();

char cwdbuff[1024];
char *cwdptr = getcwd( cwdbuff, sizeof( cwdbuff ) );
CPPUNIT_ASSERT( cwdptr );
std::string cwd = cwdptr;
char tmpdir[32] = "/tmp/xrootd-xrdec-XXXXXX";
// create the data directory
datadir = cwd + "/data";
CPPUNIT_ASSERT( mkdir( datadir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH ) == 0 );
CPPUNIT_ASSERT( mkdtemp(tmpdir) );
datadir = tmpdir;
// create a directory for each stripe
size_t nbstrps = objcfg->nbdata + 2 * objcfg->nbparity;
for( size_t i = 0; i < nbstrps; ++i )
Expand Down

0 comments on commit 552bdb0

Please sign in to comment.