Skip to content

Commit 06fd038

Browse files
committed
Make DDL semaphore permit count configurable
Extract hardcoded semaphore permit count (5) in SchemaChangeSynchronizer into a configurable system property test.max.concurrent.ddl. This allows tuning DDL concurrency when increasing parallel test thread count, without modifying source code.
1 parent d8140ac commit 06fd038

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/SchemaChangeSynchronizer.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121

2222
/**
2323
* Running multiple parallel integration tests may fail due to query timeout when trying to apply
24-
* several schema changes at once. Limit concurrently executed DDLs to 5.
24+
* several schema changes at once. Limits concurrently executed DDLs via a configurable semaphore.
25+
*
26+
* <p>The permit count defaults to 5 and can be overridden with the system property {@code
27+
* test.max.concurrent.ddl}.
2528
*/
2629
public class SchemaChangeSynchronizer {
27-
private static final Semaphore lock = new Semaphore(5);
30+
private static final int MAX_CONCURRENT_DDL = Integer.getInteger("test.max.concurrent.ddl", 5);
31+
private static final Semaphore lock = new Semaphore(MAX_CONCURRENT_DDL);
2832

2933
public static void withLock(Runnable callback) {
3034
try {

0 commit comments

Comments
 (0)