-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bad error handling when failure #17
Comments
Also, when --verbose is given, it should print the stdout output before dying due to AssertionError. |
Currently the This explains why the assertion message is If indeed you have not seen any I'll hold off on making the update till after reviewing your case, as it may be more complicated than a simple redirection. Here's an example with a wrong from simple_slurm import Slurm
slurm = Slurm(array=range(-1), verbose=True)
slurm.sbatch('echo $HOSTNAME') Using $ python demo.py
sbatch: error: Invalid generic resource (gres) specification # < ---- error shown here
Traceback (most recent call last):
File "demo.py", line 4, in <module>
slurm.sbatch('echo $HOSTNAME')
File "[...]/simple_slurm/core.py", line 131, in sbatch
assert success_msg in stdout, result.stderr
AssertionError: None # <------- not very clear message ! :S Using interactive $ ipython
In [1]: %run demo.py
sbatch: error: Invalid generic resource (gres) specification
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
File /gpfs_new/data/users/amendoza/home/Documents/simple_slurm/demo.py:4
1 from simple_slurm import Slurm
3 slurm = Slurm(gres='xxx')
----> 4 slurm.sbatch('echo $HOSTNAME')
File /gpfs_new/data/users/amendoza/home/Documents/simple_slurm/simple_slurm/core.py:131, in Slurm.sbatch(self, run_cmd, convert, verbose, sbatch_cmd, shell)
129 success_msg = 'Submitted batch job'
130 stdout = result.stdout.decode('utf-8')
--> 131 assert success_msg in stdout, result.stderr
132 if verbose:
133 print(stdout)
AssertionError: None |
It does not show what's exactly wrong and what happened from the sbatch command's output.
E.g.,
The text was updated successfully, but these errors were encountered: