From: Remi Gacogne Date: Thu, 7 Dec 2023 14:05:43 +0000 (+0100) Subject: dnsdist: Fix a race in the async regression tests X-Git-Tag: dnsdist-1.9.0-alpha4~16^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13583%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix a race in the async regression tests We need to make sure the listener is alive during the duration of the test, and not destroyed by the garbage collector. --- diff --git a/regression-tests.dnsdist/test_Async.py b/regression-tests.dnsdist/test_Async.py index 34ebf018c9..eda4a5903c 100644 --- a/regression-tests.dnsdist/test_Async.py +++ b/regression-tests.dnsdist/test_Async.py @@ -6,6 +6,7 @@ import sys import threading import unittest import dns +import dns.message import doqclient from dnsdisttests import DNSDistTest, pickAvailablePort @@ -459,8 +460,8 @@ class TestAsyncFFI(DNSDistTest, AsyncTests): end end - local asyncResponderEndpoint = newNetworkEndpoint('%s') - local listener = newNetworkListener() + asyncResponderEndpoint = newNetworkEndpoint('%s') + listener = newNetworkListener() listener:addUnixListeningEndpoint('%s', 0, gotAsyncResponse) listener:start() @@ -588,8 +589,8 @@ class TestAsyncLua(DNSDistTest, AsyncTests): end end - local asyncResponderEndpoint = newNetworkEndpoint('%s') - local listener = newNetworkListener() + asyncResponderEndpoint = newNetworkEndpoint('%s') + listener = newNetworkListener() listener:addUnixListeningEndpoint('%s', 0, gotAsyncResponse) listener:start()