Bhuvaneswaran A wrote:
> On Mon, 2009-10-26 at 17:16 +0100, Branko Čibej wrote:
>> Eh, you have a point. Premature optimization blues. Pity it can't
>> microseconds directly, though ... but it appears to me that if we use
>> datetime, one can just do:
>> import datetime
>> start_time = datetime.datetime.now()
>> # ...
>> elapsed_time = str(datetime.datetime.now() - start_time)
>> that won't zero-pad the hours, and will print microseconds instead of
>> milliseconds; but surely that shouldn't be a problem as far as parsing
>> the time for JUnit is concerned, yes?
> I guess so. We can verify once this change is deployed with
> junit/hudson. Please find attached the revised patch, ditching time
> library, but only using datetime library, similar to above suggestion.
> Can you please review the patch?
> While running the test suite, even the microseconds are accountable.
> * build/run_tests.py
> import datetime
> (_run_test): Include microseconds while printing the time taken to
> execute each test. Use datetime library instead of time library.
The patch is fine, please commit it. I ran the tests on my teensy laptop
(with a RAMdisk) and got:
Summing up the ELAPSED lines from tests.log yields:
So it would appear that we're calculating test duration correctly. If
the discrepancy between reality and what JUnit reports is bigger htan
this second or so, the problem is clearly in the log file parser, not in
the elapsed time calculation.
Received on 2009-10-27 04:38:17 CET