Merge lp:~benji/testtools/modernize-tsfr into lp:~testtools-committers/testtools/trunk
| Status: | Rejected |
|---|---|
| Rejected by: | Jonathan Lange on 2012-04-13 |
| Proposed branch: | lp:~benji/testtools/modernize-tsfr |
| Merge into: | lp:~testtools-committers/testtools/trunk |
| Prerequisite: | lp:~jml/testtools/forward-current-tags |
| Diff against target: |
266 lines (+51/-138) 2 files modified
testtools/testresult/real.py (+24/-62) testtools/tests/test_testresult.py (+27/-76) |
| To merge this branch: | bzr merge lp:~benji/testtools/modernize-tsfr |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jonathan Lange | 2012-04-12 | Disapprove on 2012-04-12 | |
|
Review via email:
|
|||
Commit Message
Modernise ThreadSafeForwa
Description of the Change
The ThreadSafeForwa
because the wrapped test result did not previously manage tags
correctly. The recent ~jml/testtools/
those issues so TSFR needed to be updated. This branch does that by
simplifying TSFR, removing some now unneeded tests, and adding some new
tests.
| Robert Collins (lifeless) wrote : | # |
In fact TSFR *must* manage tag state itself; it has to supply either
the delta (by inspection) to what its state is at each synchronisation
point, or it has to supply a back-out-
of each synchronisation point.
I'd be inclined to do the latter.
Do you have a SSCCE of the problem?
-Rob
Unmerged revisions
- 270. By Benji York on 2012-04-12
-
tweak comment
- 269. By Benji York on 2012-04-12
-
add a test that demonstrates ThreadsafeForwa
rdingResult' s use of semaphores - 268. By Benji York on 2012-04-12
-
simplify tests some more and fix recently-introduced bug in wasSuccessful
- 267. By Benji York on 2012-04-12
-
wasSuccessful might do anything, so wrap it in the semaphore too
- 266. By Benji York on 2012-04-12
-
regularize semaphore use
- 265. By Benji York on 2012-04-12
-
cleanup some unneeded concepts that I recently introduced
- 264. By Benji York on 2012-04-12
-
get ThreadsafeForwa
rdingResult tests passing - 263. By Benji York on 2012-04-12
-
checkpoint - all tag tests pass

Hey Benji,
First up, thanks so much for the contribution, and for valiantly persisting in cleaning up this somewhat unclear code. Sadly, I'm afraid it's back to the drawing with this one. I'm afraid it's our fault for not clearly communicating the intent of TSFR.
TSFR's main purpose is to send all of the events for a single test in an atomic unit, preventing the destination result from receiving input like this:
startTest(foo)
startTest(bar)
addSuccess(foo)
addSuccess(bar)
stopTest(bar)
stopTest(foo)
And instead guaranteeing input like this:
startTest(bar)
addSuccess(bar)
stopTest(bar)
startTest(foo)
addSuccess(foo)
stopTest(foo)
If I understand this patch correctly, it wraps each individual event in a semaphore, which isn't enough to guarantee this per-test atomicity.
I'll try to sketch out, or possibly even implement, a solution here.
jml