Bug #44890
jenkins : deux builds simultanés entrent en conflit
Début:
07 juillet 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
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.
Fichiers
Révisions associées
Historique
Mis à jour par Nicolas Roche il y a presque 4 ans
- Fichier 0001-tests-use-a-random-free-port-for-smtp-server-44890.patch 0001-tests-use-a-random-free-port-for-smtp-server-44890.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Statut changé de Solution proposée à Solution validée
port = 49152 + int(random.random() * (65535 - 49152))
random.randint(a, b)
?
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
Vu que ça ne concerne que les tests tu peux pousser maintenant.
Mis à jour par Nicolas Roche il y a presque 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
- Assigné à mis à 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)
Mis à jour par Nicolas Roche il y a presque 4 ans
Le patch ne semble pas satisfaisant : https://jenkins.entrouvert.org/job/hobo/2984/testReport/junit/py3-coverage-hobo.tests/test_emails/test_valid_spf/
Mis à jour par Frédéric Péters il y a presque 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
tests: use a random free port for smtp server (#44890)