mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
SEARCH-2117: Fix integration test approach, setting explicitly a [1..2000] txnId when checkCore is required.
This commit is contained in:
+4
-4
@@ -118,6 +118,9 @@ public class AlfrescoSolrUtils
|
||||
|
||||
/**
|
||||
* Get transaction.
|
||||
* When getting an unique transaction for a test, don't use this constructors.
|
||||
* As this produces a number that can be out of the range [1-2000], that is
|
||||
* the one checked by the SOLR Core to find the initial transaction is right.
|
||||
* @param deletes
|
||||
* @param updates
|
||||
* @return {@link Transaction}
|
||||
@@ -127,10 +130,7 @@ public class AlfrescoSolrUtils
|
||||
long txnCommitTime = System.currentTimeMillis();
|
||||
Transaction transaction = new Transaction();
|
||||
transaction.setCommitTimeMs(txnCommitTime);
|
||||
// A safer number for a transaction Id should be in [1-2000] range,
|
||||
// so this is the range accepted for the starting transaction number
|
||||
// on a SOLR Core
|
||||
transaction.setId(RANDOMIZER.nextInt(2000) + 1);
|
||||
transaction.setId(generateId());
|
||||
transaction.setDeletes(deletes);
|
||||
transaction.setUpdates(updates);
|
||||
return transaction;
|
||||
|
||||
+2
-1
@@ -84,7 +84,8 @@ public class DistributedAlfrescoSolrTrackerRaceIT extends AbstractAlfrescoDistri
|
||||
AclReaders aclReaders = getAclReaders(aclChangeSet, acl, singletonList("joel"), singletonList("phil"), null);
|
||||
AclReaders aclReaders2 = getAclReaders(aclChangeSet, acl2, singletonList("jim"), singletonList("phil"), null);
|
||||
|
||||
Transaction txn = getTransaction(0, 2);
|
||||
// Transaction between [1-2000] is required, when greater value checking the core will fail
|
||||
Transaction txn = getTransaction(0, 2, 1);
|
||||
long txnCommitTimeMs = txn.getCommitTimeMs();
|
||||
|
||||
// Subtract from the commit time to go beyond hole retention
|
||||
|
||||
Reference in New Issue
Block a user