Merge lp:~cjwatson/rabbitfixture/fix-test-stop-hang into lp:rabbitfixture

Proposed by Colin Watson
Status: Merged
Merged at revision: 49
Proposed branch: lp:~cjwatson/rabbitfixture/fix-test-stop-hang
Merge into: lp:rabbitfixture
Diff against target: 34 lines (+5/-1)
2 files modified
NEWS.rst (+1/-0)
rabbitfixture/tests/test_server.py (+4/-1)
To merge this branch: bzr merge lp:~cjwatson/rabbitfixture/fix-test-stop-hang
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+397229@code.launchpad.net

Commit message

Fix test_stop_hang failure introduced in 0.4.2.

Description of the change

In 0.4.2, I introduced a ctltimeout parameter to RabbitServerRunner to allow overriding the default server control timeout, and converted test_stop_hang to use it. However, changing that test was a mistake: it only wants to override ctltimeout while stopping the server, not while starting it, and overriding it while starting the server results in a high probability of timing out. Revert the test changes to get the test suite working again.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS.rst'
2--- NEWS.rst 2021-02-01 10:26:51 +0000
3+++ NEWS.rst 2021-02-01 10:35:37 +0000
4@@ -6,6 +6,7 @@
5 =====
6
7 - Add tox testing support and drop buildout.
8+- Fix ``test_stop_hang`` failure introduced in 0.4.2.
9
10 0.4.2 (2019-08-23)
11 ==================
12
13=== modified file 'rabbitfixture/tests/test_server.py'
14--- rabbitfixture/tests/test_server.py 2019-08-21 13:55:49 +0000
15+++ rabbitfixture/tests/test_server.py 2021-02-01 10:35:37 +0000
16@@ -76,7 +76,7 @@
17 f.write("while :; do sleep 1 || exit; done\n")
18 os.chmod(fakectlbin, stat.S_IRWXU)
19
20- with RabbitServer(ctltimeout=0.1) as fixture:
21+ with RabbitServer() as fixture:
22 try:
23 connect_arguments = {
24 "host": 'localhost:%s' % fixture.config.port,
25@@ -87,6 +87,9 @@
26 self.useFixture(MonkeyPatch(
27 "rabbitfixture.server.RabbitServerEnvironment.ctlbin",
28 fakectlbin))
29+ self.useFixture(MonkeyPatch(
30+ "rabbitfixture.server.RabbitServerEnvironment.ctltimeout",
31+ 0.1))
32 except Exception:
33 # self.useFixture() is not being used because we want to
34 # handle the fixture's lifecycle, so we must also be

Subscribers

People subscribed via source and target branches

to all changes: