Skip to content

Commit

Permalink
CLIENT-3201 Skip MRT tests if namespace is not configured as strong c…
Browse files Browse the repository at this point in the history
…onsistency.
  • Loading branch information
BrianNichols committed Dec 3, 2024
1 parent 1cb9242 commit 0ef8414
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/src/com/aerospike/test/async/TestAsyncTxn.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions test/src/com/aerospike/test/sync/basic/TestTxn.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
9 changes: 9 additions & 0 deletions test/src/com/aerospike/test/util/Args.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0ef8414

Please sign in to comment.