Bug #44890
jenkins : deux builds simultanés entrent en conflit
Start date:
07 July 2020
Due date:
% Done:
0%
Estimated time:
Patch proposed:
Yes
Planning:
No
Description
Il y a la fixture smtp_server qui utilise un port fixé, et ça donne :
> server = MailServer(('localhost', 10025), None) tests/test_emails.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.5/smtpd.py:662: in __init__ self.bind(localaddr) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <test_emails.smtp_server.<locals>.MailServer localhost:10025 at 0x7f97ddecef98> addr = ('localhost', 10025) def bind(self, addr): self.addr = addr > return self.socket.bind(addr) E OSError: [Errno 98] Address already in use /usr/lib/python3.5/asyncore.py:329: OSError
Piste de Benj ici #44861#note-2.
Files
Associated revisions
History
Updated by Nicolas Roche over 4 years ago
- File 0001-tests-use-a-random-free-port-for-smtp-server-44890.patch 0001-tests-use-a-random-free-port-for-smtp-server-44890.patch added
- Status changed from Nouveau to Solution proposée
- Patch proposed changed from No to Yes
Updated by Benjamin Dauvergne over 4 years ago
- Status changed from Solution proposée to Solution validée
port = 49152 + int(random.random() * (65535 - 49152))
random.randint(a, b)
?
Updated by Benjamin Dauvergne over 4 years ago
Vu que ça ne concerne que les tests tu peux pousser maintenant.
Updated by Nicolas Roche over 4 years ago
- Status changed from Solution validée to Résolu (à déployer)
- Assignee set to Nicolas Roche
oui, beaucoup plus lisible :
port = random.randint(49152, 65534)
commit 3d632d370cc412e9b42902ed3ad5b83e9767b92e Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Thu Jul 9 11:48:21 2020 +0200 tests: use a random free port for smtp server (#44890)
Updated by Nicolas Roche over 4 years ago
Le patch ne semble pas satisfaisant : https://jenkins.entrouvert.org/job/hobo/2984/testReport/junit/py3-coverage-hobo.tests/test_emails/test_valid_spf/
Updated by Frédéric Péters over 4 years ago
- Status changed from Résolu (à déployer) to Solution déployée
tests: use a random free port for smtp server (#44890)