From e71f7abf266d21c4e09d80986bede5a141304761 Mon Sep 17 00:00:00 2001 From: "S. Matthew English" Date: Thu, 16 May 2019 18:41:40 -0400 Subject: [PATCH] PIE-1606 --- ...xpectNetServicesReturnsAllServicesAsActive.java | 7 +------ .../dsl/node/factory/PantheonNodeFactory.java | 14 +++++--------- .../transaction/net/NetServicesTransaction.java | 2 -- .../jsonrpc/NetServicesAcceptanceTest.java | 4 ++-- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java index 9bef379e6b..7bac03f85e 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/condition/net/ExpectNetServicesReturnsAllServicesAsActive.java @@ -37,17 +37,12 @@ public ExpectNetServicesReturnsAllServicesAsActive(final NetServicesTransaction public void verify(final Node node) { final Map> result = node.execute(transaction); assertThat(result.keySet()) - .containsExactlyInAnyOrderElementsOf(Arrays.asList("p2p", "jsonrpc", "ws", "metrics")); + .containsExactlyInAnyOrderElementsOf(Arrays.asList("p2p", "jsonrpc", "ws")); assertThat(InetAddresses.isUriInetAddress(result.get("p2p").get("host"))).isTrue(); final int p2pPort = Integer.valueOf(result.get("p2p").get("port")); assertThat(NetworkUtility.isValidPort(p2pPort)).isTrue(); - assertThat(InetAddresses.isUriInetAddress(result.get("metrics").get("host"))).isTrue(); - final int metricsPort = Integer.valueOf(result.get("metrics").get("port")); - // TODO: Port should not be 0-valued. Refer to PAN-2703 - assertThat(NetworkUtility.isValidPort(p2pPort) || metricsPort == 0).isTrue(); - assertThat(InetAddresses.isUriInetAddress(result.get("ws").get("host"))).isTrue(); final int wsPort = Integer.valueOf(result.get("ws").get("port")); // TODO: Port should not be 0-valued. Refer to PAN-2703 diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java index a7e4cd78b5..20e714b02c 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/factory/PantheonNodeFactory.java @@ -26,7 +26,6 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApi; import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis; import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration; -import tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration; import tech.pegasys.pantheon.tests.acceptance.dsl.node.GenesisConfigProvider; import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode; @@ -132,14 +131,14 @@ public PantheonNode createArchiveNodeWithDiscoveryDisabledAndAdmin(final String } public PantheonNode createArchiveNodeNetServicesEnabled(final String name) throws IOException { - final MetricsConfiguration metricsConfiguration = MetricsConfiguration.createDefault(); - metricsConfiguration.setEnabled(true); - metricsConfiguration.setPort(0); - metricsConfiguration.setPushEnabled(false); + // TODO: Enable metrics coverage in the acceptance tests. See PIE-1606 + // final MetricsConfiguration metricsConfiguration = MetricsConfiguration.createDefault(); + // metricsConfiguration.setEnabled(true); + // metricsConfiguration.setPort(0); return create( new PantheonFactoryConfigurationBuilder() .setName(name) - .setMetricsConfiguration(metricsConfiguration) + // .setMetricsConfiguration(metricsConfiguration) .setJsonRpcConfiguration(jsonRpcConfigWithAdmin()) .webSocketEnabled() .setP2pEnabled(true) @@ -147,12 +146,9 @@ public PantheonNode createArchiveNodeNetServicesEnabled(final String name) throw } public PantheonNode createArchiveNodeNetServicesDisabled(final String name) throws IOException { - final MetricsConfiguration metricsConfiguration = MetricsConfiguration.createDefault(); - metricsConfiguration.setEnabled(false); return create( new PantheonFactoryConfigurationBuilder() .setName(name) - .setMetricsConfiguration(metricsConfiguration) .setJsonRpcConfiguration(jsonRpcConfigWithAdmin()) .setP2pEnabled(false) .build()); diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/net/NetServicesTransaction.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/net/NetServicesTransaction.java index daefc711a1..b0c8758a7e 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/net/NetServicesTransaction.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/net/NetServicesTransaction.java @@ -37,8 +37,6 @@ public Map> execute(final JsonRequestFactories reque Request request = netServicesJsonRpcRequestFactory.customNet(); - System.out.println(); - CustomNetJsonRpcRequestFactory.NetServicesResponse netServicesResponse = request.send(); netServicesActive = netServicesResponse.getResult(); } catch (final Exception e) { diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/jsonrpc/NetServicesAcceptanceTest.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/jsonrpc/NetServicesAcceptanceTest.java index 9d62a44082..db7849abc2 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/jsonrpc/NetServicesAcceptanceTest.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/jsonrpc/NetServicesAcceptanceTest.java @@ -30,7 +30,7 @@ public class NetServicesAcceptanceTest extends AcceptanceTestBase { @Test public void shouldIndicateNetServicesEnabled() throws Exception { final ClusterConfiguration clusterConfiguration = - new ClusterConfigurationBuilder().setAwaitPeerDiscovery(false).build(); + new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build(); noDiscoveryCluster = new Cluster(clusterConfiguration, net); nodeA = pantheon.createArchiveNodeNetServicesEnabled("nodeA"); nodeB = pantheon.createArchiveNodeNetServicesEnabled("nodeB"); @@ -43,7 +43,7 @@ public void shouldIndicateNetServicesEnabled() throws Exception { @Test public void shouldNotDisplayDisabledServices() throws Exception { final ClusterConfiguration clusterConfiguration = - new ClusterConfigurationBuilder().setAwaitPeerDiscovery(false).build(); + new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build(); noDiscoveryCluster = new Cluster(clusterConfiguration, net); nodeA = pantheon.createArchiveNodeNetServicesDisabled("nodeA"); nodeB = pantheon.createArchiveNodeNetServicesDisabled("nodeB");