Skip to content

Commit

Permalink
Extremely provisonal at best
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou committed Aug 8, 2023
1 parent 15d77ea commit 41e537b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/node/node_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ namespace ccf

if (status != HTTP_STATUS_OK)
{
return;
const auto& location = headers.find(http::headers::LOCATION);
if (
status == HTTP_STATUS_PERMANENT_REDIRECT &&
Expand Down
2 changes: 1 addition & 1 deletion tests/infra/basicperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def run(args):
statistics[
"initial_primary_shutdown_time"
] = datetime.datetime.now().isoformat()
primary.stop()
# primary.stop()
primary_has_stopped = True
old_primary = primary
# primary, _ = network.wait_for_new_primary(primary)
Expand Down
7 changes: 4 additions & 3 deletions tests/infra/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def _add_node(
read_only_ledger_dirs=None,
from_snapshot=True,
snapshots_dir=None,
wait_for_target_to_become_primary=True,
wait_for_target_to_become_primary=False,
**kwargs,
):
# Contact primary if no target node is set
Expand Down Expand Up @@ -388,8 +388,9 @@ def _add_node(

if wait_for_target_to_become_primary:
current_primary, _ = self.find_primary()
while current_primary != target_node:
current_primary, _ = self.find_primary()
current_primary.stop()
# while current_primary != target_node:
# current_primary, _ = self.find_primary()

node.join(
lib_name=lib_name,
Expand Down
2 changes: 2 additions & 0 deletions tests/infra/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import json
import time
import http
import traceback

import ccf._versionifier

Expand Down Expand Up @@ -627,6 +628,7 @@ def client(
**kwargs,
):
if self.network_state == NodeNetworkState.stopped:
traceback.print_exc()
raise RuntimeError(
f"Cannot create client for node {self.local_node_id} as node is stopped"
)
Expand Down

0 comments on commit 41e537b

Please sign in to comment.