Skip to content

Commit

Permalink
halve swarm test for the poor build hamsters. Moar view cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed Dec 30, 2023
1 parent 92be787 commit b3d94ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public class View {
private final ReadWriteLock viewChange = new ReentrantReadWriteLock(
true);
private final ViewManagement viewManagement;
private final EventValidation viewValidation;
private volatile EventValidation validation;
private final EventValidation validation;
private volatile ScheduledFuture<?> futureGossip;

public View(Context<Participant> context, ControlledIdentifierMember member, InetSocketAddress endpoint,
Expand All @@ -121,7 +120,6 @@ public View(Context<Participant> context, ControlledIdentifierMember member, Ine
this.params = params;
this.digestAlgo = digestAlgo;
this.context = context;
this.viewValidation = validation;
this.roundTimers = new RoundScheduler(String.format("Timers for: %s", context.getId()), context.timeToLive());
this.node = new Node(member, endpoint);
viewManagement = new ViewManagement(this, context, params, metrics, node, digestAlgo);
Expand All @@ -134,7 +132,7 @@ public View(Context<Participant> context, ControlledIdentifierMember member, Ine
r -> new EntranceServer(gateway.getClientIdentityProvider(), r, metrics),
EntranceClient.getCreate(metrics), Entrance.getLocalLoopback(node, service));
gossiper = new RingCommunications<>(context, node, comm);
this.validation = EventValidation.NONE;
this.validation = validation;
}

/**
Expand Down Expand Up @@ -386,11 +384,6 @@ void finalizeViewChange() {
});
}

void finalizeViewValidation() {
validation = viewValidation;
log.info("Finalized view validation on: {}", node.getId());
}

/**
* Test accessible
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ void bootstrap(NoteWrapper nw, final ScheduledExecutorService sched, final Durat
context.activate(node);

resetBootstrapView();
view.viewChange(() -> {
install(
new Ballot(currentView(), Collections.emptyList(), Collections.singletonList(node.getId()), digestAlgo));
view.finalizeViewValidation();
});
view.viewChange(() -> install(
new Ballot(currentView(), Collections.emptyList(), Collections.singletonList(node.getId()), digestAlgo)));

view.scheduleViewChange();
view.schedule(dur, sched);
Expand Down Expand Up @@ -237,7 +234,6 @@ void join() {
log.info("Joined view: {} cardinality: {} count: {} on: {}", current, context.cardinality(),
context.totalCount(), node.getId());
onJoined.complete(null);
view.finalizeViewValidation();
} finally {
joinLock.unlock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class SwarmTest {
"large_tests");

static {
CARDINALITY = largeTests ? 500 : 100;
CARDINALITY = largeTests ? 500 : 50;
}

private List<Router> communications = new ArrayList<>();
Expand Down

0 comments on commit b3d94ae

Please sign in to comment.