Search in sources :

Example 6 with ClusterMembershipChangeEvent

use of com.netflix.titus.api.clustermembership.model.event.ClusterMembershipChangeEvent in project titus-control-plane by Netflix.

the class AbstractKubeMembershipExecutorTest method expectClusterMembershipChangeEvent.

private void expectClusterMembershipChangeEvent(ClusterMembershipRevision<ClusterMember> revision, ClusterMembershipChangeEvent.ChangeType changeType) throws InterruptedException {
    ClusterMembershipChangeEvent memberEvent = findNextMemberEvent(revision.getCurrent().getMemberId());
    assertThat(memberEvent.getChangeType()).isEqualTo(changeType);
    assertThat(memberEvent.getRevision()).isEqualTo(revision);
}
Also used : ClusterMembershipChangeEvent(com.netflix.titus.api.clustermembership.model.event.ClusterMembershipChangeEvent)

Example 7 with ClusterMembershipChangeEvent

use of com.netflix.titus.api.clustermembership.model.event.ClusterMembershipChangeEvent in project titus-control-plane by Netflix.

the class KubeClusterMembershipConnectorTest method doRegistrationChange.

private ClusterMembershipRevision<ClusterMember> doRegistrationChange(Supplier<ClusterMembershipRevision<ClusterMember>> action) throws InterruptedException {
    long now = titusRuntime.getClock().wallTime();
    ClusterMembershipRevision<ClusterMember> newRevision = action.get();
    assertThat(newRevision.getTimestamp()).isGreaterThanOrEqualTo(now);
    assertThat(connector.getLocalClusterMemberRevision()).isEqualTo(newRevision);
    ClusterMembershipEvent registrationEvent1 = connectorEvents.takeNext(TIMEOUT);
    assertThat(registrationEvent1).isInstanceOf(ClusterMembershipChangeEvent.class);
    assertThat(((ClusterMembershipChangeEvent) registrationEvent1).getChangeType()).isEqualTo(ClusterMembershipChangeEvent.ChangeType.Updated);
    return newRevision;
}
Also used : ClusterMember(com.netflix.titus.api.clustermembership.model.ClusterMember) ClusterMemberGenerator.activeClusterMember(com.netflix.titus.testkit.model.clustermembership.ClusterMemberGenerator.activeClusterMember) ClusterMembershipChangeEvent(com.netflix.titus.api.clustermembership.model.event.ClusterMembershipChangeEvent) ClusterMembershipEvent(com.netflix.titus.api.clustermembership.model.event.ClusterMembershipEvent)

Aggregations

ClusterMembershipChangeEvent (com.netflix.titus.api.clustermembership.model.event.ClusterMembershipChangeEvent)7 ClusterMembershipEvent (com.netflix.titus.api.clustermembership.model.event.ClusterMembershipEvent)4 ClusterMember (com.netflix.titus.api.clustermembership.model.ClusterMember)1 ClusterMemberGenerator.activeClusterMember (com.netflix.titus.testkit.model.clustermembership.ClusterMemberGenerator.activeClusterMember)1 Test (org.junit.Test)1