hpcugent / vsc-base

Basic Python libraries used by UGent's HPC group
Other
14 stars 51 forks source link

don't call connect if mail host is specified #331

Closed smoors closed 1 year ago

smoors commented 2 years ago

as explained in the smtplib docs at https://docs.python.org/3/library/smtplib.html#smtplib.SMTP.connect "This method is automatically invoked by the constructor if a host is specified during instantiation."

the code in mail.py is written in such a way that the mail_host must always be specified, so connect is always called automatically.

calling connect manually (i.e. a second time) causes the process to hang without sending any mails.

smoors commented 1 year ago

@itkovian any idea why jenkins fails?

itkovian commented 1 year ago

@smoors

FAIL: test_timeout (test.run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpcugent_github.com/jobs/vsc-base/branches/PR-331/workspace/test/run.py", line 295, in test_timeout
    do_test(False)
  File "/var/lib/jenkins/jobs/hpcugent_github.com/jobs/vsc-base/branches/PR-331/workspace/test/run.py", line 273, in do_test
    self.assertFalse(check_pid(pids[depth]), "main depth=%s pid (pids %s) is killed by timeout" % (depth, pids,))
AssertionError: True is not false : main depth=2 pid (pids [13852, 13850, 13849]) is killed by timeout