Skip to content

Commit

Permalink
Added some debug to MetricPluginTest due to spurious failure
Browse files Browse the repository at this point in the history
Added jfc attach file exclusion to .gitignore
  • Loading branch information
alarmnummer committed Feb 4, 2016
1 parent 8558d43 commit 31bbf73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ hazelcast-ra/*.epoch
hazelcast-all/dependency-reduced-pom.xml
hazelcast/dependency-reduced-pom.xml
performance*.log
.attach_pid*
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

import com.hazelcast.config.Config;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.instance.GroupProperty;
import com.hazelcast.internal.metrics.LongProbeFunction;
import com.hazelcast.internal.metrics.MetricsRegistry;
import com.hazelcast.internal.metrics.ProbeLevel;
import com.hazelcast.spi.impl.NodeEngineImpl;
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -49,8 +46,7 @@ public void testGetPeriodMillis() {
}

@Test
@Ignore
public void testRunWithProblematicProbe() throws IOException {
public void testRunWithProblematicProbe() throws Throwable {
metricsRegistry.register(this, "broken", MANDATORY, new LongProbeFunction() {
@Override
public long get(Object source) throws Exception {
Expand All @@ -60,7 +56,12 @@ public long get(Object source) throws Exception {

plugin.run(logWriter);

assertContains("broken=java.lang.RuntimeException:error");
try {
assertContains("broken=java.lang.RuntimeException:error");
} catch (Throwable t) {
System.out.println(metricsRegistry.getNames());
throw t;
}
}

@Test
Expand Down

0 comments on commit 31bbf73

Please sign in to comment.