global tags unnecessarily inflate concurrent test results

Bug #986434 reported by Gary Poster
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Fix Released
Critical
Robert Collins

Bug Description

This is, to be clear, a relatively mild annoyance, not a bug.

ThreadsafeForwardingResult handles global tags in _add_result_with_semaphore by wrapping each test with them: they are all set before the test results are rendered, and then all unset. This keeps the tags from polluting the tags in other concurrent tests.

If I understand the subunit tag semantics correctly, having local per-test tags would be semantically equivalent. This would also halve the number of times that global tags must be included in the stream. In the case of the LP parallel test stream, this would be a significant space savings, because layers are indicated with global tags, and we have many layers running at a time, and each layer tag name is long.

Working from the LP subunit parallel test output at http://dl.dropbox.com/u/420990/testrepo-0, a hack on the output showed that the reduced file would be 59% the size of the original (from http://pastebin.ubuntu.com/939060/ fwiw). For a 37M file, that's a decent amount of savings.

(Perhaps it could be a separate tags line, in case someone diagnosing the stream really wanted to know the source of the tag.)

Revision history for this message
Robert Collins (lifeless) wrote :

I think a clean way to address this would be a normalising filter after the multiplexing occurs, it can identify redundant tag operations and clean things up.
e.g.
==
tag: -foo bar
time: T
tag: -bar foo
time: T+n
==
->
==
==

Changed in testtools:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Gary Poster (gary) wrote :

I talked with Robert about this and he is OK with my initial suggestion, which could work fine with his suggestion.

He pointed out that the general act of multiplexing streams breaks the subunit ability to cat two streams and have global tags from the first affect the second. That should be noted somewhere.

Revision history for this message
Robert Collins (lifeless) wrote :

Doing what Gary suggests would be find too.

Revision history for this message
Robert Collins (lifeless) wrote :

upgrading to critical given that this is tightly related to the misapplied-global-tags reported in testrepository.

Changed in testtools:
importance: Wishlist → Critical
Revision history for this message
Robert Collins (lifeless) wrote :

I'm going to Just Land a fix for this, as jml is busy/soon to be awol and the change is trivial. I'll take care of any post-landing followups that may be requested.

Changed in testtools:
assignee: nobody → Robert Collins (lifeless)
milestone: none → next
Changed in testtools:
status: Triaged → Fix Committed
Changed in testtools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.