Project

General

Profile

Support #32860

test proxylogger test_log_on_connector_availability_change est instable

Added by Benjamin Dauvergne about 1 year ago. Updated about 1 year ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07 May 2019
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Vu sur des tests jenkins d'une branche n'ayant rien à voir: https://jenkins2.entrouvert.org/job/passerelle-wip/job/wip%252F32853-sp-fr-ne-plus-remonter-les-erreu/1/ pour le ticket #32853:

Certainement l'ordre de ResourceLog qui n'est pas déterministe.

tests.test_proxylogger.test_log_on_connector_availability_change (from pytest)
En échec depuis 1 build (Depuis En échec#1 )
A duré 31 ms.
Ajouter une description
Message d'erreur

assert 'connector "é...) is now down' == 'GET http://ex...net/ (=> 404)'   - connector "éléphant" (Feed) is now down   + GET http://example.net/ (=> 404)

Pile d'exécution

db = None, connector = <Feed: éléphant>

    def test_log_on_connector_availability_change(db, connector):
        connector.title = u'éléphant'
        with HTTMock(up_mock):  # set connector as up
            connector.availability()
        ResourceLog.objects.all().delete()
        with HTTMock(down_mock):  # set connector as down
            connector.availability()
        assert len(ResourceLog.objects.all()) == 2
>       assert ResourceLog.objects.all()[0].message == 'GET http://example.net/ (=> 404)'
E       assert 'connector "é...) is now down' == 'GET http://ex...net/ (=> 404)'
E         - connector "éléphant" (Feed) is now down
E         + GET http://example.net/ (=> 404)

tests/test_proxylogger.py:77: AssertionError

Sortie d'erreur standard

GET http://example.net/ (=> 200)
GET http://example.net/ (=> 404)
connector "éléphant" (Feed) is now down

Related issues

Duplicated by Passerelle - Autre #37224: non déterminisme dans les tests du ProxyLogger Rejeté 25 Oct 2019

History

#1 Updated by Emmanuel Cazenave about 1 year ago

Même test, trace différente (https://jenkins2.entrouvert.org/job/passerelle-wip/job/wip%252F33348-atal/3/testReport/) :

    def test_log_on_connector_availability_change(db, connector):
        connector.title = u'éléphant'
        with HTTMock(up_mock):  # set connector as up
            connector.availability()
        ResourceLog.objects.all().delete()
        with HTTMock(down_mock):  # set connector as down
            connector.availability()
        assert len(ResourceLog.objects.all()) == 2
        assert ResourceLog.objects.all()[0].message == 'GET http://example.net/ (=> 404)'
        assert ResourceLog.objects.all()[1].level == 'error'
        assert ResourceLog.objects.all()[1].message == u'connector "éléphant" (Feed) is now down'

        with HTTMock(up_mock):  # set connector as up
            connector.availability()
        assert len(ResourceLog.objects.all()) == 3
>       assert ResourceLog.objects.all()[2].level == 'info'
E       AssertionError: assert u'error' == 'info'
E         - error
E         + info

#2 Updated by Frédéric Péters 7 months ago

  • Duplicated by Autre #37224: non déterminisme dans les tests du ProxyLogger added

Also available in: Atom PDF