Changeset bb718416 in trunk
- Timestamp:
-
2016-04-08T06:59:42Z
(9 years ago)
- Author:
- Brian Warner <warner@…>
- Branches:
- master
- Children:
- 47b9218, db517e8
- Parents:
- 8279d919
- Message:
-
test/common: add a slight stall in tearDown
With the new Foolscap-0.11.0 (which changed the way connections are
established), I'm seeing DirtyReactorErrors? getting thrown by
allmydata.test.test_system.SystemTest?.test_filesystem_with_cli_in_subprocess
, on a host that has three IP addresses (one is 127.0.0.1, two is wifi,
three is a VPN). The test itself is getting skipped because bin/tahoe
isn't in the expected place, but by that point, the nodes have already
been launched and have established connections over one of the three
hints (probably 127.0.0.1). The test terminates so quickly that the
connections to the other two addresses have not finished being
abandoned. The extra stall seems to give Foolscap enough time to reap
the cancelled connections and makes the DRT go away.
I think an offline test, or maybe one with a single external IP address,
wouldn't hit this case.
Arbitrary stalls are never very satisfactory, of course. Usually there
is some threshold delay value, below which it fails reliably, above
which it works on my own machine (for now). This one is weird: the
threshold seems to be below the resolution of the system clock. Stalling
for one nanosecond was enough to fix the problem, but using a simple
fireEventually() didn't work.
-
File:
-
Legend:
- Unmodified
- Added
- Removed
-
r8279d919
|
rbb718416
|
|
454 | 454 | def tearDown(self): |
455 | 455 | log.msg("shutting down SystemTest services") |
456 | | d = self.sparent.stopService() |
| 456 | d = self.stall(0.001) |
| 457 | d.addCallback(lambda _: self.sparent.stopService()) |
457 | 458 | d.addBoth(flush_but_dont_ignore) |
458 | 459 | return d |