use of org.apache.ignite.spi.failover.GridFailoverTestContext in project ignite by apache.
the class GridJobStealingFailoverSpiSelfTest method testThiefIdNotSet.
/**
* @throws Exception If test failed.
*/
public void testThiefIdNotSet() throws Exception {
ClusterNode rmt = getSpiContext().remoteNodes().iterator().next();
GridTestJobResult failed = new GridTestJobResult(rmt);
ClusterNode other = getSpi().failover(new GridFailoverTestContext(new GridTestTaskSession(), failed), new ArrayList<>(getSpiContext().nodes()));
assert other != null;
assert other != rmt;
assert other.equals(getSpiContext().localNode());
checkAttributes(failed.getJobContext(), rmt, 1);
}
use of org.apache.ignite.spi.failover.GridFailoverTestContext in project ignite by apache.
the class GridJobStealingFailoverSpiSelfTest method testNonZeroFailoverCount.
/**
* @throws Exception If test failed.
*/
public void testNonZeroFailoverCount() throws Exception {
ClusterNode rmt = getSpiContext().remoteNodes().iterator().next();
GridTestJobResult failed = new GridTestJobResult(rmt);
failed.getJobContext().setAttribute(FAILOVER_ATTEMPT_COUNT_ATTR, getSpi().getMaximumFailoverAttempts() - 1);
ClusterNode other = getSpi().failover(new GridFailoverTestContext(new GridTestTaskSession(), failed), new ArrayList<>(getSpiContext().nodes()));
assert other != null;
assert other != rmt;
assert other == getSpiContext().localNode();
checkAttributes(failed.getJobContext(), rmt, getSpi().getMaximumFailoverAttempts());
}
use of org.apache.ignite.spi.failover.GridFailoverTestContext in project ignite by apache.
the class GridNeverFailoverSpiSelfTest method testAlwaysNull.
/**
* @throws Exception If failed.
*/
public void testAlwaysNull() throws Exception {
List<ClusterNode> nodes = new ArrayList<>();
ClusterNode node = new GridTestNode(UUID.randomUUID());
nodes.add(node);
assert getSpi().failover(new GridFailoverTestContext(new GridTestTaskSession(), new GridTestJobResult(node)), nodes) == null;
}
Aggregations