promise/plugin: improve check-rx-saturated messages
Showing
-
Owner
@jhuge, FYI, I've started to get the following test failure after this commit:
(py3.venv) kirr@deca:~/src/wendelin/slapos/slapos.toolbox$ python -m unittest discover -v -s slapos/test/promise/plugin/ -t . -k TestCheckRXSaturated test_promise_fail (slapos.test.promise.plugin.test_check_rx_saturated.TestCheckRXSaturated.test_promise_fail) ... 2023-10-11 17:10:02,357 - slapos.grid.promise - INFO - Checking promise check-rx-saturated.py... 2023-10-11 17:10:02,408 - slapos.grid.promise - ERROR - sequence item 0: expected str instance, float found Traceback (most recent call last): File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/generic.py", line 500, in run self.sense() File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/promise/plugin/check_rx_saturated.py", line 41, in sense ", ".join(max_rx_list))) ^^^^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 0: expected str instance, float found ok test_promise_success (slapos.test.promise.plugin.test_check_rx_saturated.TestCheckRXSaturated.test_promise_success) ... 2023-10-11 17:10:02,416 - slapos.grid.promise - INFO - Checking promise check-rx-saturated.py... 2023-10-11 17:10:02,467 - slapos.grid.promise - ERROR - sequence item 0: expected str instance, float found Traceback (most recent call last): File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/generic.py", line 500, in run self.sense() File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/promise/plugin/check_rx_saturated.py", line 45, in sense ", ".join(max_rx_list))) ^^^^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 0: expected str instance, float found ERROR ====================================================================== ERROR: test_promise_success (slapos.test.promise.plugin.test_check_rx_saturated.TestCheckRXSaturated.test_promise_success) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/test/promise/plugin/test_check_rx_saturated.py", line 64, in test_promise_success self.launcher.run() File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/__init__.py", line 879, in run raise PromiseError("Promise %r failed with output: %s" % ( slapos.grid.promise.PromiseError: Promise 'check-rx-saturated.py' failed with output: sequence item 0: expected str instance, float found Traceback (most recent call last): File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/generic.py", line 500, in run self.sense() File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/promise/plugin/check_rx_saturated.py", line 45, in sense ", ".join(max_rx_list))) ^^^^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 0: expected str instance, float found ---------------------------------------------------------------------- Ran 2 tests in 0.122s FAILED (errors=1)
-
Maintainer
Hi, strange I remember seeing the tests passed when I ran them, I think I forgot to run the tests after I rebased with master. Anyway this reminded me that it is better for the user to format the floats with less decimal places. I pushed the fix.
-
Owner
Good day, Joanne. Thanks for feedback and for the correction.
Please register or sign in to comment