Script to generate reports from logs, and bug fixes:

* log_report.py is a script to generate debugging reports and combine the logs
of the locally run mainchain and sidechain servers.

* Log address book before pytest start

* Cleanup test utils

* Modify log_analyzer so joins all logs into a single file

* Organize "all" log as a dictionary

* Allow ConfigFile and Section classes to be pickled:
This caused a bug on mac platforms. Linux did not appear to use pickle.

* Add account history command to py scripts

* Add additional logging

* Add support to run sidechains under rr:

This is an undocumented feature to help debugging.
If the environment variable `RIPPLED_SIDECHAIN_RR` is set, it is assumed to
point to the rr executable. Sidechain 0 will then be run under rr.
This commit is contained in:
seelabs
2021-09-30 12:07:35 -04:00
parent d57f88fc18
commit d86b1f8b7d
11 changed files with 486 additions and 123 deletions

View File

@@ -17,13 +17,19 @@ from ripple_client import RippleClient
class Network:
# If run_server is None, run all the servers.
# This is useful to help debugging
def __init__(self,
exe: str,
configs: List[ConfigFile],
*,
command_logs: Optional[List[str]] = None,
run_server: Optional[List[bool]] = None,
extra_args: Optional[List[List[str]]] = None):
def __init__(
self,
exe: str,
configs: List[ConfigFile],
*,
command_logs: Optional[List[str]] = None,
run_server: Optional[List[bool]] = None,
# undocumented feature. If with_rr is not None, assume it points to the rr debugger executable
# and run server 0 under rr
with_rr: Optional[str] = None,
extra_args: Optional[List[List[str]]] = None):
self.with_rr = with_rr
if not configs:
raise ValueError(f'Must specify at least one config')
@@ -164,7 +170,11 @@ class Network:
client = self.clients[i]
to_run = [client.exe, '--conf', client.config_file_name]
print(f'Starting server {client.config_file_name}')
if self.with_rr and i == 0:
to_run = [self.with_rr, 'record'] + to_run
print(f'Starting server with rr {client.config_file_name}')
else:
print(f'Starting server {client.config_file_name}')
fout = open(os.devnull, 'w')
p = subprocess.Popen(to_run + extra_args[i],
stdout=fout,