diff --git a/test/src/com/aerospike/test/async/TestAsyncTxn.java b/test/src/com/aerospike/test/async/TestAsyncTxn.java index 468384dba..f22f57aaa 100644 --- a/test/src/com/aerospike/test/async/TestAsyncTxn.java +++ b/test/src/com/aerospike/test/async/TestAsyncTxn.java @@ -16,8 +16,8 @@ */ package com.aerospike.test.async; -import org.junit.Test; import org.junit.BeforeClass; +import org.junit.Test; import com.aerospike.client.AbortStatus; import com.aerospike.client.AerospikeException; @@ -31,13 +31,13 @@ import com.aerospike.client.ResultCode; import com.aerospike.client.Txn; import com.aerospike.client.Value; +import com.aerospike.client.listener.AbortListener; import com.aerospike.client.listener.BatchRecordArrayListener; +import com.aerospike.client.listener.CommitListener; import com.aerospike.client.listener.DeleteListener; import com.aerospike.client.listener.ExecuteListener; import com.aerospike.client.listener.RecordArrayListener; import com.aerospike.client.listener.RecordListener; -import com.aerospike.client.listener.AbortListener; -import com.aerospike.client.listener.CommitListener; import com.aerospike.client.listener.WriteListener; import com.aerospike.client.policy.BatchPolicy; import com.aerospike.client.policy.Policy; @@ -50,6 +50,8 @@ public class TestAsyncTxn extends TestAsync { @BeforeClass public static void register() { + // Multi-record transactions require strong consistency namespaces. + org.junit.Assume.assumeTrue(args.scMode); RegisterTask task = client.register(null, TestUDF.class.getClassLoader(), "udf/record_example.lua", "record_example.lua", Language.LUA); task.waitTillComplete(); } diff --git a/test/src/com/aerospike/test/sync/basic/TestTxn.java b/test/src/com/aerospike/test/sync/basic/TestTxn.java index 6c12dbbc9..629b25f8a 100644 --- a/test/src/com/aerospike/test/sync/basic/TestTxn.java +++ b/test/src/com/aerospike/test/sync/basic/TestTxn.java @@ -45,6 +45,8 @@ public class TestTxn extends TestSync { @BeforeClass public static void register() { + // Multi-record transactions require strong consistency namespaces. + org.junit.Assume.assumeTrue(args.scMode); RegisterTask task = client.register(null, TestUDF.class.getClassLoader(), "udf/record_example.lua", "record_example.lua", Language.LUA); task.waitTillComplete(); } diff --git a/test/src/com/aerospike/test/util/Args.java b/test/src/com/aerospike/test/util/Args.java index 23014ccb4..05ff67680 100644 --- a/test/src/com/aerospike/test/util/Args.java +++ b/test/src/com/aerospike/test/util/Args.java @@ -34,6 +34,7 @@ import com.aerospike.client.Log.Level; import com.aerospike.client.async.EventLoopType; import com.aerospike.client.cluster.Node; +import com.aerospike.client.cluster.Partitions; import com.aerospike.client.policy.AuthMode; import com.aerospike.client.policy.ClientPolicy; import com.aerospike.client.policy.Policy; @@ -57,6 +58,7 @@ public class Args { public int totalTimeout = 1000; public boolean enterprise; public boolean hasTtl; + public boolean scMode; public Args() { host = "127.0.0.1"; @@ -248,7 +250,14 @@ private static void logUsage(Options options) { /** * Some database calls need to know how the server is configured. */ + @SuppressWarnings("resource") public void setServerSpecific(IAerospikeClient client) { + Partitions partitions = client.getCluster().partitionMap.get(namespace); + + if (partitions != null) { + scMode = partitions.scMode; + } + Node node = client.getNodes()[0]; String editionFilter = "edition"; String namespaceFilter = "namespace/" + namespace;