diff --git a/test/heapwatch/metrics_delta.py b/test/heapwatch/metrics_delta.py index 9371591452..b6aa2ae8a4 100644 --- a/test/heapwatch/metrics_delta.py +++ b/test/heapwatch/metrics_delta.py @@ -54,20 +54,24 @@ def test_metric_line_re(): def parse_metrics(fin): out = dict() - for line in fin: - if not line: - continue - line = line.strip() - if not line: - continue - if line[0] == '#': - continue - m = metric_line_re.match(line) - if m: - out[m.group(1)] = num(m.group(2)) - else: - ab = line.split() - out[ab[0]] = num(ab[1]) + try: + for line in fin: + if not line: + continue + line = line.strip() + if not line: + continue + if line[0] == '#': + continue + m = metric_line_re.match(line) + if m: + out[m.group(1)] = num(m.group(2)) + else: + ab = line.split() + out[ab[0]] = num(ab[1]) + except: + print(f'An exception occurred in parse_metrics: {sys.exc_info()}') + pass return out # return b-a @@ -396,12 +400,12 @@ def process_files(self, args, nick=None, metrics_files=None): prevbi = None for path in sorted(metrics_files): - with open(path, 'rt') as fin: + with open(path, 'rt', encoding="utf-8") as fin: cur = parse_metrics(fin) bijsonpath = path.replace('.metrics', '.blockinfo.json') bi = None if os.path.exists(bijsonpath): - with open(bijsonpath, 'rt') as fin: + with open(bijsonpath, 'rt', encoding="utf-8") as fin: bi = json.load(fin) curtime = os.path.getmtime(path) self.txPool.append(cur.get('algod_tx_pool_count{}')) diff --git a/test/testdata/deployednettemplates/recipes/hello-world/genesis.json b/test/testdata/deployednettemplates/recipes/hello-world/genesis.json index ac841670ca..218b694d5f 100644 --- a/test/testdata/deployednettemplates/recipes/hello-world/genesis.json +++ b/test/testdata/deployednettemplates/recipes/hello-world/genesis.json @@ -1,19 +1,30 @@ { "NetworkName": "", "VersionModifier": "", - "ConsensusProtocol": "", + "ConsensusProtocol": "future", "FirstPartKeyRound": 0, "LastPartKeyRound": 1000300, + "PartKeyDilution": 0, "Wallets": [ { "Name": "Wallet1", - "Stake": 50, + "Stake": 25, "Online": true }, { "Name": "Wallet2", - "Stake": 50, + "Stake": 25, "Online": true + }, + { + "Name": "Wallet3", + "Stake": 25, + "Online": true + }, + { + "Name": "Wallet4", + "Stake": 25, + "Online": false } ] } diff --git a/test/testdata/deployednettemplates/recipes/hello-world/net.json b/test/testdata/deployednettemplates/recipes/hello-world/net.json index 7d03c46692..08b885f178 100644 --- a/test/testdata/deployednettemplates/recipes/hello-world/net.json +++ b/test/testdata/deployednettemplates/recipes/hello-world/net.json @@ -49,6 +49,52 @@ "ConfigJSONOverride": "{ \"DNSBootstrapID\": \".algodev.network\",\"DeadlockDetection\": -1, \"PeerPingPeriodSeconds\": 30, \"EnableAgreementReporting\": true, \"EnableAgreementTimeMetrics\": true, \"EnableAssembleStats\": true, \"EnableProcessBlockStats\": true }" } ] + }, + { + "Name": "N1", + "Group": "", + "Nodes": [ + { + "Name": "node1", + "Wallets": [ + { + "Name": "Wallet3", + "ParticipationOnly": false + } + ], + "APIEndpoint": "{{APIEndpoint}}", + "APIToken": "{{APIToken}}", + "EnableTelemetry": false, + "TelemetryURI": "{{TelemetryURI}}", + "EnableMetrics": false, + "MetricsURI": "{{MetricsURI}}", + "EnableService": false, + "EnableBlockStats": false, + "ConfigJSONOverride": "{ \"TxPoolExponentialIncreaseFactor\": 1, \"DNSBootstrapID\": \".algodev.network\", \"DeadlockDetection\": -1, \"PeerPingPeriodSeconds\": 30, \"BaseLoggerDebugLevel\": 4, \"EnableProfiler\": true, \"CadaverSizeTarget\": 0, \"EnableAccountUpdatesStats\": true}" + } + ] + }, + { + "Name": "NPN1", + "Group": "", + "Nodes": [ + { + "Name": "nonParticipatingNode1", + "Wallets": [ + { + "Name": "Wallet4", + "ParticipationOnly": false + } + ], + "APIEndpoint": "{{APIEndpoint}}", + "APIToken": "{{APIToken}}", + "EnableTelemetry": false, + "EnableMetrics": false, + "EnableService": false, + "EnableBlockStats": false, + "ConfigJSONOverride": "{ \"TxPoolExponentialIncreaseFactor\": 1, \"DNSBootstrapID\": \".algodev.network\", \"DeadlockDetection\": -1, \"BaseLoggerDebugLevel\": 4, \"CadaverSizeTarget\": 0 }" + } + ] } ] } diff --git a/test/testdata/deployednettemplates/recipes/hello-world/topology.json b/test/testdata/deployednettemplates/recipes/hello-world/topology.json index ef4f4ac8c6..acc7cca9ec 100644 --- a/test/testdata/deployednettemplates/recipes/hello-world/topology.json +++ b/test/testdata/deployednettemplates/recipes/hello-world/topology.json @@ -7,6 +7,14 @@ { "Name": "R2", "Template": "AWS-US-EAST-1-Small" + }, + { + "Name": "N1", + "Template": "AWS-US-EAST-1-Small" + }, + { + "Name": "NPN1", + "Template": "AWS-US-EAST-1-Small" } ] }