ResearchComputing / curc-bench

benchmarking and testing utilities for CU-Boulder Research Computing resources
2 stars 2 forks source link

bytes bugs #167

Open AaronTHolt opened 6 years ago

AaronTHolt commented 6 years ago

Need to add a 'b' in front of the quotes.

(cb_venv) -bash-4.2$ bench submit --test node --reservation 11.7-shas Traceback (most recent call last): File "/projects/holtat/cb_dev/cb_venv/bin/bench", line 9, in load_entry_point('bench===v0.3-167-gf0660dc', 'console_scripts', 'bench')() File "/projects/holtat/cb_dev/curc-bench/src/bench/driver.py", line 239, in driver error_nodes = args.error_nodes, File "/projects/holtat/cb_dev/curc-bench/src/bench/framework_submit.py", line 25, in execute self.submit(prefix=prefix, **kwargs) File "/projects/holtat/cb_dev/curc-bench/src/bench/framework_submit.py", line 90, in submit self.logger.info(': '.join(result.splitlines()))

AaronTHolt commented 6 years ago

One in reserve too

(cb_venv) -bash-4.2$ bench reserve --test node Traceback (most recent call last): File "/projects/holtat/cb_dev/cb_venv/bin/bench", line 9, in load_entry_point('bench===v0.3-167-gf0660dc', 'console_scripts', 'bench')() File "/projects/holtat/cb_dev/curc-bench/src/bench/driver.py", line 252, in driver directory, File "/projects/holtat/cb_dev/curc-bench/src/bench/framework_reserve.py", line 68, in execute if "ReservationName=" in output:

AaronTHolt commented 6 years ago

One more in slurm.py

(cb_venv) -bash-4.2$ bench reserve --test bandwidth Traceback (most recent call last): File "/projects/holtat/cb_dev/cb_venv/bin/bench", line 9, in load_entry_point('bench===v0.3-167-gf0660dc', 'console_scripts', 'bench')() File "/projects/holtat/cb_dev/curc-bench/src/bench/driver.py", line 252, in driver directory, File "/projects/holtat/cb_dev/curc-bench/src/bench/framework_reserve.py", line 65, in execute output = bench.slurm.scontrol(subcommand='show', reservation=self.reservation_name) File "/projects/holtat/cb_dev/curc-bench/src/bench/slurm.py", line 41, in scontrol return _run_command(command) File "/projects/holtat/cb_dev/curc-bench/src/bench/slurm.py", line 54, in _run_command stderr_message = stderr.strip().replace('\n', ':')

AaronTHolt commented 5 years ago

I hotfixed the issues in production by adding a "b" in front of the strings, but this breaks the test suite:

File "/projects/holtat/cb_dev/curc-bench/src/bench/framework_submit.py", line 90, in submit self.logger.info(b': '.join(result.splitlines())) TypeError: sequence item 0: expected a bytes-like object, str found

File "/projects/holtat/cb_dev/curc-bench/src/bench/framework_reserve.py", line 68, in execute if b"ReservationName=" in output: TypeError: 'in ' requires string as left operand, not bytes

AaronTHolt commented 4 years ago

Added a function that checks if output is a string or bytes, and converts to bytes if needed.