Skip to content

Commit

Permalink
Fix tests after server upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanEckert committed Jan 9, 2024
1 parent 2cfc6ec commit 0d8613b
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import com.qfs.store.NoTransactionException;
import com.qfs.store.TypeValues;
import com.qfs.store.build.impl.UnitTestDatastoreBuilder;
import com.qfs.store.impl.Datastore;
import com.qfs.store.query.ICursor;
import com.qfs.store.record.IRecordReader;
import com.qfs.store.transaction.DatastoreTransactionException;
Expand Down Expand Up @@ -111,13 +110,13 @@ public static void performGC() {

/*
* Note. We can't rely on calling MemUtils.runGC() because on some servers (alto), it seems not enough.
* Plus, MemUtils relies on on heap memory....
* Plus, MemUtils relies on on-heap memory....
*/
for (int i = 0; i < MAX_GC_STEPS; i++) {
try {
System.gc();

Thread.sleep(1 << i); // give gc some times.
Thread.sleep(1 << i); // give gc some time.

// create a soft assertion that allows getting the assertions results of all assertions
// even if the first assertion is already false.
Expand All @@ -134,7 +133,7 @@ public static void performGC() {
}

void createApplication(
final ThrowingLambda.ThrowingBiConsumer<Datastore, IActivePivotManager> actions) {
final ThrowingLambda.ThrowingBiConsumer<IDatastore, IActivePivotManager> actions) {
final IDatastoreSchemaDescription datastoreSchema =
StartBuilding.datastoreSchema()
.withStore(
Expand Down Expand Up @@ -321,7 +320,7 @@ void createApplication(
.end()
.build())
.build();
final ApplicationInTests<Datastore> application =
final ApplicationInTests<IDatastore> application =
ApplicationInTests.builder()
.withDatastore(datastoreSchema)
.withManager(userManagerDescription)
Expand All @@ -332,7 +331,7 @@ void createApplication(
}

void createMinimalApplication(
final ThrowingLambda.ThrowingBiConsumer<Datastore, IActivePivotManager> actions) {
final ThrowingLambda.ThrowingBiConsumer<IDatastore, IActivePivotManager> actions) {

final IDatastoreSchemaDescription datastoreSchema =
StartBuilding.datastoreSchema()
Expand Down Expand Up @@ -382,7 +381,7 @@ void createMinimalApplication(
.build())
.build();

final ApplicationInTests<Datastore> application =
final ApplicationInTests<IDatastore> application =
ApplicationInTests.builder()
.withDatastore(datastoreSchema)
.withManager(userManagerDescription)
Expand All @@ -397,7 +396,7 @@ void createMinimalApplication(
*
* @param datastore datastore to fill
*/
static void fillApplicationMinimal(final Datastore datastore) {
static void fillApplicationMinimal(final IDatastore datastore) {
AtomicInteger operationsBatch = new AtomicInteger();
datastore.edit(
tm -> {
Expand Down Expand Up @@ -429,7 +428,7 @@ static void fillApplicationMinimal(final Datastore datastore) {
*
* @param datastore datastore to fill
*/
static void fillApplication(final Datastore datastore) {
static void fillApplication(final IDatastore datastore) {
datastore.edit(
tm -> {
final int peopleCount = STORE_PEOPLE_COUNT;
Expand Down Expand Up @@ -470,7 +469,7 @@ static void fillApplication(final Datastore datastore) {
*
* @param datastore datastore to fill
*/
static void fillApplicationMinimalWithSingleValue(final Datastore datastore) {
static void fillApplicationMinimalWithSingleValue(final IDatastore datastore) {
AtomicInteger operationsBatch = new AtomicInteger();

datastore.edit(
Expand Down Expand Up @@ -502,7 +501,7 @@ static void fillApplicationMinimalWithSingleValue(final Datastore datastore) {
*
* @param datastore datastore to fill
*/
static void editApplicationMinimalWithSingleValue(final Datastore datastore) {
static void editApplicationMinimalWithSingleValue(final IDatastore datastore) {
datastore.edit(
tm -> {
final int peopleCount = STORE_PEOPLE_COUNT;
Expand Down Expand Up @@ -534,7 +533,7 @@ static void editApplicationMinimalWithSingleValue(final Datastore datastore) {
* @param datastore datastore to fill
*/
static void fillApplicationWithBranches(
final Datastore datastore, Collection<String> branches, boolean minimalFilling)
final IDatastore datastore, Collection<String> branches, boolean minimalFilling)
throws IllegalArgumentException {
if (minimalFilling) {
fillApplicationMinimal(datastore);
Expand Down Expand Up @@ -940,7 +939,7 @@ ApplicationInTests<IDatastore> createDistributedApplicationWithKeepAllEpochPolic
StartBuilding.cube("QueryCubeA")
.withContributorsCount()
.withCalculations(
context -> Copper.count().multiply(Copper.constant(2L)).publish(context))
context -> Copper.count().multiply(Copper.constant(2L)).as("Contributors count times 2").publish(context))
.asQueryCube()
.withClusterDefinition()
.withClusterId(clusterName)
Expand Down

0 comments on commit 0d8613b

Please sign in to comment.