Project

General

Profile

Bug #44890

jenkins : deux builds simultanés entrent en conflit

Added by Valentin Deniaud over 4 years ago. Updated over 4 years ago.

Status:
Fermé
Priority:
Normal
Assignee:
Category:
-
Target version:
-
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

Revision 3d632d37 (diff)
Added by Nicolas Roche over 4 years ago

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

History

#1

Updated by Nicolas Roche over 4 years ago

#2

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

#3

Updated by Benjamin Dauvergne over 4 years ago

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

#4

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

Updated by Frédéric Péters over 4 years ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF