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 834d336 commit 0c679a8
Showing 1 changed file with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,26 @@ void evolutionSchemaTest() {
void evolutionConcurrencySchemaTest() throws ExecutionException, InterruptedException {
int threadPoolSize = 10;

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();
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();
}
}
}
}
Expand Down

0 comments on commit 0c679a8

Please sign in to comment.