Changeset 43a601f in mod_gnutls


Ignore:
Timestamp:
Aug 14, 2020, 4:47:21 PM (8 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio
Children:
ec26b87
Parents:
e080eef
Message:

Proxy resume test: Allow initial close/resume open to interleave

Almost always closing the initial connection is logged before
resumption, but "almost" is not enough for a reliable test. Either way
the messages are just a few milliseconds apart on my system.

Instead the test now matches the resume and open messages for the
resume session by handler thread ID to increase reliability.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/tests/37_TLS_reverse_proxy_resume_session/hooks.py

    re080eef r43a601f  
    11import re
    2 from mgstest import require_match
     2from mgstest import require_match, TestExpectationFailed
    33from pathlib import Path
    44
     
    1616
    1717def post_check(conn_log, response_log):
    18     conn_opened = re.compile(r'TLS connection opened.')
    19     conn_closed = re.compile(r'TLS connection closed.')
    20     session_resumed = re.compile(r'TLS session resumed.')
     18    conn_opened = re.compile(r'tid (\d+)\].* TLS connection opened.')
     19    session_resumed = re.compile(r'tid (\d+)\].* TLS session resumed.')
    2120
    2221    print('Checking if the backend server log contains session resumption')
     
    2625
    2726        require_match(conn_opened, log)
    28         require_match(conn_closed, log)
    2927        print('Initial session found.')
    3028
    31         require_match(session_resumed, log)
    32         require_match(conn_opened, log)
    33         require_match(conn_closed, log)
     29        id1 = require_match(session_resumed, log).group(1)
     30        id2 = require_match(conn_opened, log).group(1)
     31        if id1 != id2:
     32            raise TestExpectationFailed(
     33                'thread ID mismatch between resume and open message: '
     34                f'{id1} != {id2}')
    3435        print('Resumed session found.')
Note: See TracChangeset for help on using the changeset viewer.