Skip to content

Commit

Permalink
[Flyway]:
Browse files Browse the repository at this point in the history
1) SCAN SELECT -> SELECT FROM flyway schema history table
2) Tested Info command
3) Tested Repair command
4) Tested Validate command
  • Loading branch information
KirillKurdyukov committed Apr 11, 2024
1 parent 0c679a8 commit 2418007
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,25 @@ void evolutionSchemaTest() {
void evolutionConcurrencySchemaTest() throws ExecutionException, InterruptedException {
int threadPoolSize = 10;

try (ExecutorService threadPool = Executors.newFixedThreadPool(threadPoolSize)) {

for (int migrationStep = 0; migrationStep < EVOLUTION_SCHEMA_MIGRATION_DIRS.length; migrationStep++) {
List<Future<?>> taskFutures = new ArrayList<>();

for (int i = 0; i < threadPoolSize * 2; i++) {
int finalMigrationStep = migrationStep;

taskFutures.add(
threadPool.submit(() -> assertTrue(
createFlyway("classpath:db/" +
EVOLUTION_SCHEMA_MIGRATION_DIRS[finalMigrationStep])
.load().migrate().success
))
);
}

for (Future<?> taskFuture : taskFutures) {
taskFuture.get();
}
ExecutorService threadPool = Executors.newFixedThreadPool(threadPoolSize);

for (int migrationStep = 0; migrationStep < EVOLUTION_SCHEMA_MIGRATION_DIRS.length; migrationStep++) {
List<Future<?>> taskFutures = new ArrayList<>();

for (int i = 0; i < threadPoolSize * 2; i++) {
int finalMigrationStep = migrationStep;

taskFutures.add(
threadPool.submit(() -> assertTrue(
createFlyway("classpath:db/" +
EVOLUTION_SCHEMA_MIGRATION_DIRS[finalMigrationStep])
.load().migrate().success
))
);
}

for (Future<?> taskFuture : taskFutures) {
taskFuture.get();
}
}
}
Expand Down

0 comments on commit 2418007

Please sign in to comment.