Skip to content

Commit

Permalink
Fix backup stress test by deleting only the created folders
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed Oct 13, 2015
1 parent 6bc89bb commit 25b9858
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -53,18 +53,21 @@ public void shouldBehaveCorrectlyUnderStress() throws Exception
String backupHostname = fromEnv( "BACKUP_SERVICE_STRESS_BACKUP_HOSTNAME", DEFAULT_HOSTNAME );
int backupPort = parseInt( fromEnv( "BACKUP_SERVICE_STRESS_BACKUP_PORT", DEFAULT_PORT ) );

File storeDirectory = new File( directory, "store" );
File workDirectory = new File( directory, "work" );
Callable<Integer> callable = new BackupServiceStressTestingBuilder()
.until( untilTimeExpired( durationInMinutes, MINUTES ) )
.withStore( ensureExists( new File( directory, "store" ) ) )
.withBackupDirectory( ensureExists( new File( directory, "work" ) ) )
.withStore( ensureExists( storeDirectory ) )
.withBackupDirectory( ensureExists( workDirectory ) )
.withBackupAddress( backupHostname, backupPort )
.build();

int brokenStores = callable.call();

assertEquals( 0, brokenStores );

FileUtils.deleteRecursively( new File( directory ) );
FileUtils.deleteRecursively( storeDirectory );
FileUtils.deleteRecursively( workDirectory );
}

private static File ensureExists( File directory ) throws IOException
Expand Down

0 comments on commit 25b9858

Please sign in to comment.