Projet

Général

Profil

Bug #44890

jenkins : deux builds simultanés entrent en conflit

Ajouté par Valentin Deniaud il y a presque 4 ans. Mis à jour il y a presque 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
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

Révision 3d632d37 (diff)
Ajouté par Nicolas Roche il y a presque 4 ans

tests: use a random free port for smtp server (#44890)

Historique

#1

Mis à jour par Nicolas Roche il y a presque 4 ans

#2

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) ?

#3

Mis à jour par Benjamin Dauvergne il y a presque 4 ans

Vu que ça ne concerne que les tests tu peux pousser maintenant.

#4

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)
#6

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

Formats disponibles : Atom PDF