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
=== modified file 'NEWS.rst'
--- NEWS.rst 2021-02-01 10:26:51 +0000
+++ NEWS.rst 2021-02-01 10:35:37 +0000
@@ -6,6 +6,7 @@
6=====6=====
77
8- Add tox testing support and drop buildout.8- Add tox testing support and drop buildout.
9- Fix ``test_stop_hang`` failure introduced in 0.4.2.
910
100.4.2 (2019-08-23)110.4.2 (2019-08-23)
11==================12==================
1213
=== modified file 'rabbitfixture/tests/test_server.py'
--- rabbitfixture/tests/test_server.py 2019-08-21 13:55:49 +0000
+++ rabbitfixture/tests/test_server.py 2021-02-01 10:35:37 +0000
@@ -76,7 +76,7 @@
76 f.write("while :; do sleep 1 || exit; done\n")76 f.write("while :; do sleep 1 || exit; done\n")
77 os.chmod(fakectlbin, stat.S_IRWXU)77 os.chmod(fakectlbin, stat.S_IRWXU)
7878
79 with RabbitServer(ctltimeout=0.1) as fixture:79 with RabbitServer() as fixture:
80 try:80 try:
81 connect_arguments = {81 connect_arguments = {
82 "host": 'localhost:%s' % fixture.config.port,82 "host": 'localhost:%s' % fixture.config.port,
@@ -87,6 +87,9 @@
87 self.useFixture(MonkeyPatch(87 self.useFixture(MonkeyPatch(
88 "rabbitfixture.server.RabbitServerEnvironment.ctlbin",88 "rabbitfixture.server.RabbitServerEnvironment.ctlbin",
89 fakectlbin))89 fakectlbin))
90 self.useFixture(MonkeyPatch(
91 "rabbitfixture.server.RabbitServerEnvironment.ctltimeout",
92 0.1))
90 except Exception:93 except Exception:
91 # self.useFixture() is not being used because we want to94 # self.useFixture() is not being used because we want to
92 # handle the fixture's lifecycle, so we must also be95 # handle the fixture's lifecycle, so we must also be

Subscribers

People subscribed via source and target branches

to all changes: