Message93582
| Author |
mark.dickinson |
| Recipients |
chuck, mark.dickinson, ned.deily, ronaldoussoren |
| Date |
2009年10月05日.08:36:11 |
| SpamBayes Score |
0.0038303246 |
| Marked as misclassified |
No |
| Message-id |
<1254731773.14.0.16873031633.issue7042@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> If this is about passing time, there should be better ways (than
> those which break if your computer gets faster).
Agreed. The challenge is to find ways that don't add too much in the
way of extra complexity, fragility, or dependencies to the unit test.
How about replacing the xrange(100000000) loop with something like this,
which allows 30 seconds of real time and then fails with a timeout
message:
start_time = time.time()
while time.time() - start_time < 5.0:
<use some process time here>
if signal.getitimer(self.itimer) == (0.0, 0.0):
break
else:
self.fail('timeout waiting for virtual timer signal') |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年10月05日 08:36:13 | mark.dickinson | set | recipients:
+ mark.dickinson, ronaldoussoren, ned.deily, chuck |
| 2009年10月05日 08:36:13 | mark.dickinson | set | messageid: <1254731773.14.0.16873031633.issue7042@psf.upfronthosting.co.za> |
| 2009年10月05日 08:36:12 | mark.dickinson | link | issue7042 messages |
| 2009年10月05日 08:36:11 | mark.dickinson | create |
|