Search in sources :

Example 1 with SetNodeStateRequest

use of com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest in project vespa by vespa-engine.

the class SetNodeStateTest method deadline_exceeded_fails_set_node_state_request.

@Test
public void deadline_exceeded_fails_set_node_state_request() throws Exception {
    expectedException.expectMessage("Task exceeded its version wait deadline");
    expectedException.expect(DeadlineExceededException.class);
    SetNodeStateRequest request = createDummySetNodeStateRequest();
    request.handleFailure(RemoteClusterControllerTask.FailureCondition.DEADLINE_EXCEEDED);
    request.getResult();
}
Also used : SetNodeStateRequest(com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest) Test(org.junit.Test)

Example 2 with SetNodeStateRequest

use of com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest in project vespa by vespa-engine.

the class SetNodeStateTest method set_node_state_requests_not_initially_marked_as_failed.

@Test
public void set_node_state_requests_not_initially_marked_as_failed() {
    SetNodeStateRequest request = createDummySetNodeStateRequest();
    assertFalse(request.isFailed());
}
Also used : SetNodeStateRequest(com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest) Test(org.junit.Test)

Example 3 with SetNodeStateRequest

use of com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest in project vespa by vespa-engine.

the class SetNodeStateTest method set_node_state_requests_are_by_default_tagged_as_having_version_ack_dependency.

@Test
public void set_node_state_requests_are_by_default_tagged_as_having_version_ack_dependency() {
    SetNodeStateRequest request = createDummySetNodeStateRequest();
    assertTrue(request.hasVersionAckDependency());
}
Also used : SetNodeStateRequest(com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest) Test(org.junit.Test)

Example 4 with SetNodeStateRequest

use of com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest in project vespa by vespa-engine.

the class SetNodeStateTest method leadership_loss_fails_set_node_state_request.

// Technically, this failure mode currently applies to all requests, but it's only really
// important to test (and expected to happen) for requests that have dependencies on cluster
// state version publishing.
@Test
public void leadership_loss_fails_set_node_state_request() throws Exception {
    expectedException.expectMessage("Leadership lost before request could complete");
    expectedException.expect(UnknownMasterException.class);
    SetNodeStateRequest request = createDummySetNodeStateRequest();
    request.handleFailure(RemoteClusterControllerTask.FailureCondition.LEADERSHIP_LOST);
    request.getResult();
}
Also used : SetNodeStateRequest(com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest) Test(org.junit.Test)

Example 5 with SetNodeStateRequest

use of com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest in project vespa by vespa-engine.

the class SetNodeStateTest method set_node_state_requests_may_override_version_ack_dependency.

@Test
public void set_node_state_requests_may_override_version_ack_dependency() {
    SetNodeStateRequest request = new SetNodeStateRequest(createDummyId(), new SetUnitStateRequestImpl("music/storage/1").setNewState("user", "maintenance", "whatever reason.").setResponseWait(SetUnitStateRequest.ResponseWait.NO_WAIT));
    assertFalse(request.hasVersionAckDependency());
}
Also used : SetNodeStateRequest(com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest) Test(org.junit.Test)

Aggregations

SetNodeStateRequest (com.yahoo.vespa.clustercontroller.core.restapiv2.requests.SetNodeStateRequest)6 Test (org.junit.Test)6