Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to record results for remote endpoints #62

Open
s1na opened this issue Jul 5, 2024 · 4 comments
Open

Fails to record results for remote endpoints #62

s1na opened this issue Jul 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@s1na
Copy link

s1na commented Jul 5, 2024

Version
v0.3.1

Platform
Darwin Mac-mini 22.6.0

Description

I have two remote RPC endpoints. I have installed flood and vegeta both locally and on those machines. When I try the following command:

flood eth_getBlockByNumber geth=ubuntu@IP1:localhost:8545 reth=ubuntu@IP2:localhost:8545

it proceeds to execute the tests, however at the end when it wants to record the results I get this exception:

Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/local/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/sina/Library/Python/3.11/lib/python/site-packages/flood/tests/load_tests/load_test_runs.py", line 179, in run_load_test
    result = _run_load_test_remotely(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sina/Library/Python/3.11/lib/python/site-packages/flood/tests/load_tests/load_test_runs.py", line 380, in _run_load_test_remotely
    subprocess.check_output(cmd.split(' '), stderr=subprocess.DEVNULL)
  File "/usr/local/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ssh', 'ubuntu@IP1', 'bash', '-c', "'source", '~/.profile;', 'python3', '-m', 'flood', '/tmp/flood__09f2f3ce-07d0-4b3d-b8af-597cf415626a', 'reth=http://localhost:8545', '--output', '/tmp/flood__09f2f3ce-07d0-4b3d-b8af-597cf415626a', '--no-figures', "'"]' returned non-zero exit status 1.

(I get one such exception from each endpoint)

@s1na s1na added the bug Something isn't working label Jul 5, 2024
@kamuik16
Copy link

kamuik16 commented Jul 5, 2024

Happens on Ubuntu 24.04 as well.

@sslivkoff
Copy link
Member

are you using the same exact version of flood on each machine? try installing latest flood commit on each

@s1na
Copy link
Author

s1na commented Jul 9, 2024

As per @mattsse suggestion I tried running flood locally on those machines and it was failing with this error:

lxml.html.clean module is now a separate project lxml_html_clean.
Install lxml[html_clean] or lxml_html_clean directly.

This was fixed by pip install lxml_html_clean. However still the crash persists when I try to do the comparison benchmark.

For reference they are both running flood 0.3.1.

@s1na
Copy link
Author

s1na commented Jul 16, 2024

To shine more light on this. What happens is the remote server command sort-of fails (it produces generates results) but for some reason I'm not aware prints get_border_chars() got an unexpected keyword argument 'indent' and then exits with status 1. Which makes the ssh command fail and panic. So the results are not retrieved to be processed locally.

I worked around it for now by silencing the panic:

diff --git a/flood/tests/load_tests/load_test_runs.py b/flood/tests/load_tests/load_test_runs.py
index 0bd1d09..1e497f4 100644
--- a/flood/tests/load_tests/load_test_runs.py
+++ b/flood/tests/load_tests/load_test_runs.py
@@ -377,7 +377,12 @@ def _run_load_test_remotely(
         extra_kwargs=extra_kwargs.lstrip(),
     )
     cmd = cmd.strip()
-    subprocess.check_output(cmd.split(' '), stderr=subprocess.DEVNULL)
+    try:
+        subprocess.check_output(cmd.split(' '), stderr=subprocess.DEVNULL)
+    except subprocess.CalledProcessError as cpe_error:
+        print(f"CalledProcessError: {cpe_error}")
+        decoded_output = cpe_error.output.decode('utf-8', errors='replace')
+        print(f"Output (stdout + stderr): {decoded_output}")

     # retrieve benchmark results
     if verbose:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants