Search in sources :

Example 1 with NoopTracingSpi

use of org.apache.ignite.spi.tracing.NoopTracingSpi in project ignite by apache.

the class MixedTracingSpiTest method testNodesWithDifferentTracingSpiPrintsWarningOnConsistencyCheck.

/**
 * Start two nodes: one with noop tracing spi and another one with open census tracing spi.
 * <p/>
 * Cause both tracing spi instances are annotated with {@code @IgniteSpiConsistencyChecked(optional = true)}
 * 'Remote SPI with the same name is not configured: <TracingSpiInstance></>' warning message is expected on
 * node start.
 * <p/>
 * Besides that 'Failed to create span from serialized value' is expected, cause it's not possible
 * to deserialize {@code NoopSpan.INSTANCE} from {@link NoopTracingSpi} on the node
 * with {@link OpenCensusTracingSpi}.
 *
 * @throws Exception If failed.
 */
@Test
public void testNodesWithDifferentTracingSpiPrintsWarningOnConsistencyCheck() throws Exception {
    List<LogListener> listeners = prepareLogListeners();
    startGrid(getConfiguration(getTestIgniteInstanceName(0) + "node-with-noop-tracing").setTracingSpi(new NoopTracingSpi()).setGridLogger(testLog));
    startGrid(getConfiguration(getTestIgniteInstanceName(1) + "node-with-open-census-tracing").setTracingSpi(new OpenCensusTracingSpi()).setGridLogger(testLog));
    listeners.forEach(lsnr -> assertTrue(lsnr.check()));
}
Also used : LogListener(org.apache.ignite.testframework.LogListener) OpenCensusTracingSpi(org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi) NoopTracingSpi(org.apache.ignite.spi.tracing.NoopTracingSpi) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 2 with NoopTracingSpi

use of org.apache.ignite.spi.tracing.NoopTracingSpi in project ignite by apache.

the class MixedTracingSpiTest method testNodesWithNoopTracingSpiPrintsNothingOnConsistencyCheck.

/**
 * Start two nodes, both with noop tracing spi instances. No warning messages are expected.
 *
 * @throws Exception If failed.
 */
@Test
public void testNodesWithNoopTracingSpiPrintsNothingOnConsistencyCheck() throws Exception {
    List<LogListener> listeners = prepareLogListeners();
    startGrid(getConfiguration(getTestIgniteInstanceName(0) + "node-with-noop-tracing").setTracingSpi(new NoopTracingSpi()).setGridLogger(testLog));
    startGrid(getConfiguration(getTestIgniteInstanceName(1) + "node-with-noop-tracing").setTracingSpi(new NoopTracingSpi()).setGridLogger(testLog));
    listeners.forEach(lsnr -> assertFalse(lsnr.check()));
}
Also used : LogListener(org.apache.ignite.testframework.LogListener) NoopTracingSpi(org.apache.ignite.spi.tracing.NoopTracingSpi) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

NoopTracingSpi (org.apache.ignite.spi.tracing.NoopTracingSpi)2 LogListener (org.apache.ignite.testframework.LogListener)2 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)2 Test (org.junit.Test)2 OpenCensusTracingSpi (org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi)1