Merge lp:~sidnei/zope.testing/parallel-layer-teardown into lp:zope.testing

Proposed by Sidnei da Silva
Status: Merged
Approved by: Sidnei da Silva
Approved revision: 367
Merge reported by: Sidnei da Silva
Merged at revision: not available
Proposed branch: lp:~sidnei/zope.testing/parallel-layer-teardown
Merge into: lp:zope.testing
Diff against target: 132 lines (+38/-10)
4 files modified
CHANGES.txt (+3/-0)
src/zope/testing/testrunner/runner.py (+11/-10)
src/zope/testing/testrunner/testrunner-layers-buff.txt (+3/-0)
src/zope/testing/testrunner/testrunner-layers.txt (+21/-0)
To merge this branch: bzr merge lp:~sidnei/zope.testing/parallel-layer-teardown
Reviewer Review Type Date Requested Status
Sidnei da Silva Approve
Review via email: mp+25151@code.launchpad.net

Description of the change

- When layers were run in parallel, their tearDown was not
  called. Additionally, the first layer which was run in the main
  thread did not have it's tearDown called either.

To post a comment you must log in.
Revision history for this message
Tres Seaver (tseaver) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sidnei da Silva wrote:
> Sidnei da Silva has proposed merging lp:~sidnei/zope.testing/parallel-layer-teardown into lp:zope.testing.
>
> Requested reviews:
> ZTK steering group (ztk-steering-group)
>
>
> - When layers were run in parallel, their tearDown was not
> called. Additionally, the first layer which was run in the main
> thread did not have it's tearDown called either.

Bot fixes look reasonable to me.

I'm sad to see more extraneious noise in the output, but that is a
different issue: I think the layer setup / teardown output should be
suppressed at "normal" verbosity levels.

+1 to merge both.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkvsImQACgkQ+gerLs4ltQ7G9QCfV6tWq8fgtfCbcQL5pR1j+JEj
AE8AnjKJommnlXMEKTU5FaCceUH17qUq
=5dRs
-----END PGP SIGNATURE-----

Revision history for this message
Sidnei da Silva (sidnei) wrote :

Actually, there's no extra *new* noise. If you look at the tests, you'll see that the tearDown messages were printed just right when not running in parallel. The bug was exactly that it was not running the tearDown when in parallel, so the messages were not printed because the code was never executed.

I like the idea of suppressing those messages when the verbosity is low. I've opened Bug #580072 to track it.

Revision history for this message
Sidnei da Silva (sidnei) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES.txt'
2--- CHANGES.txt 2010-04-30 15:41:02 +0000
3+++ CHANGES.txt 2010-05-12 14:00:53 +0000
4@@ -8,6 +8,9 @@
5 been moved to a separate zope.testrunner module, and will be removed from
6 zope.testing in 4.0.0, together with zope.testing.doctest.
7
8+- When layers were run in parallel, their tearDown was not
9+ called. Additionally, the first layer which was run in the main
10+ thread did not have it's tearDown called either.
11
12 3.9.4 (2010-04-13)
13 ==================
14
15=== modified file 'src/zope/testing/testrunner/runner.py'
16--- src/zope/testing/testrunner/runner.py 2010-04-11 01:31:21 +0000
17+++ src/zope/testing/testrunner/runner.py 2010-05-12 14:00:53 +0000
18@@ -231,7 +231,6 @@
19 break
20
21 if should_resume:
22- setup_layers = None
23 if layers_to_run:
24 self.ran += resume_tests(
25 self.script_parts, self.options, self.features,
26@@ -601,15 +600,17 @@
27 output.start_tear_down(name_from_layer(l))
28 t = time.time()
29 try:
30- if hasattr(l, 'tearDown'):
31- l.tearDown()
32- except NotImplementedError:
33- output.tear_down_not_supported()
34- if not optional:
35- raise CanNotTearDown(l)
36- else:
37- output.stop_tear_down(time.time() - t)
38- del setup_layers[l]
39+ try:
40+ if hasattr(l, 'tearDown'):
41+ l.tearDown()
42+ except NotImplementedError:
43+ output.tear_down_not_supported()
44+ if not optional:
45+ raise CanNotTearDown(l)
46+ else:
47+ output.stop_tear_down(time.time() - t)
48+ finally:
49+ del setup_layers[l]
50
51
52 cant_pm_in_subprocess_message = """
53
54=== modified file 'src/zope/testing/testrunner/testrunner-layers-buff.txt'
55--- src/zope/testing/testrunner/testrunner-layers-buff.txt 2009-10-07 16:53:44 +0000
56+++ src/zope/testing/testrunner/testrunner-layers-buff.txt 2010-05-12 14:00:53 +0000
57@@ -111,6 +111,9 @@
58 Running in a subprocess.
59 Set up sampletests_buffering.Layer2 in N.NNN seconds.
60 Ran 2 tests with 0 failures and 0 errors in N.NNN seconds.
61+ Tear down sampletests_buffering.Layer2 ... not supported
62+ Tearing down left over layers:
63+ Tear down sampletests_buffering.Layer1 ... not supported
64 Total: 3 tests, 0 failures, 0 errors in N.NNN seconds.
65 False
66
67
68=== modified file 'src/zope/testing/testrunner/testrunner-layers.txt'
69--- src/zope/testing/testrunner/testrunner-layers.txt 2009-04-22 12:26:42 +0000
70+++ src/zope/testing/testrunner/testrunner-layers.txt 2010-05-12 14:00:53 +0000
71@@ -136,6 +136,8 @@
72 Set up samplelayers.Layer1 in N.NNN seconds.
73 Set up samplelayers.Layer11 in N.NNN seconds.
74 Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
75+ Tear down samplelayers.Layer11 in N.NNN seconds.
76+ Tear down samplelayers.Layer1 in N.NNN seconds.
77 Running samplelayers.Layer111 tests:
78 Running in a subprocess.
79 Set up samplelayers.Layerx in N.NNN seconds.
80@@ -143,6 +145,10 @@
81 Set up samplelayers.Layer11 in N.NNN seconds.
82 Set up samplelayers.Layer111 in N.NNN seconds.
83 Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
84+ Tear down samplelayers.Layer111 in N.NNN seconds.
85+ Tear down samplelayers.Layerx in N.NNN seconds.
86+ Tear down samplelayers.Layer11 in N.NNN seconds.
87+ Tear down samplelayers.Layer1 in N.NNN seconds.
88 Running samplelayers.Layer112 tests:
89 Running in a subprocess.
90 Set up samplelayers.Layerx in N.NNN seconds.
91@@ -150,26 +156,41 @@
92 Set up samplelayers.Layer11 in N.NNN seconds.
93 Set up samplelayers.Layer112 in N.NNN seconds.
94 Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
95+ Tear down samplelayers.Layer112 in N.NNN seconds.
96+ Tear down samplelayers.Layerx in N.NNN seconds.
97+ Tear down samplelayers.Layer11 in N.NNN seconds.
98+ Tear down samplelayers.Layer1 in N.NNN seconds.
99 Running samplelayers.Layer12 tests:
100 Running in a subprocess.
101 Set up samplelayers.Layer1 in N.NNN seconds.
102 Set up samplelayers.Layer12 in N.NNN seconds.
103 Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
104+ Tear down samplelayers.Layer12 in N.NNN seconds.
105+ Tear down samplelayers.Layer1 in N.NNN seconds.
106 Running samplelayers.Layer121 tests:
107 Running in a subprocess.
108 Set up samplelayers.Layer1 in N.NNN seconds.
109 Set up samplelayers.Layer12 in N.NNN seconds.
110 Set up samplelayers.Layer121 in N.NNN seconds.
111 Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
112+ Tear down samplelayers.Layer121 in N.NNN seconds.
113+ Tear down samplelayers.Layer12 in N.NNN seconds.
114+ Tear down samplelayers.Layer1 in N.NNN seconds.
115 Running samplelayers.Layer122 tests:
116 Running in a subprocess.
117 Set up samplelayers.Layer1 in N.NNN seconds.
118 Set up samplelayers.Layer12 in N.NNN seconds.
119 Set up samplelayers.Layer122 in N.NNN seconds.
120 Ran 34 tests with 0 failures and 0 errors in N.NNN seconds.
121+ Tear down samplelayers.Layer122 in N.NNN seconds.
122+ Tear down samplelayers.Layer12 in N.NNN seconds.
123+ Tear down samplelayers.Layer1 in N.NNN seconds.
124 Running zope.testing.testrunner.layer.UnitTests tests:
125 Running in a subprocess.
126 Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
127 Ran 192 tests with 0 failures and 0 errors in N.NNN seconds.
128+ Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
129+ Tearing down left over layers:
130+ Tear down samplelayers.Layer1 in N.NNN seconds.
131 Total: 405 tests, 0 failures, 0 errors in N.NNN seconds.
132 False

Subscribers

People subscribed via source and target branches