mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] *: add (individual) timings to test cron runner
Useful to know if the crons are slow during testing.
This commit is contained in:
parent
bad016b830
commit
e5efd52674
@ -893,11 +893,12 @@ class Environment:
|
||||
crons = xids or self._default_crons
|
||||
print('running crons', crons, file=sys.stderr)
|
||||
for xid in crons:
|
||||
t0 = time.time()
|
||||
print('\trunning cron', xid, '...', file=sys.stderr)
|
||||
_, model, cron_id = self('ir.model.data', 'xmlid_lookup', xid)
|
||||
assert model == 'ir.cron', "Expected {} to be a cron, got {}".format(xid, model)
|
||||
self('ir.cron', 'method_direct_trigger', [cron_id], **kw)
|
||||
print('\tdone', file=sys.stderr)
|
||||
print('\tdone %.3fs' % (time.time() - t0), file=sys.stderr)
|
||||
print('done', file=sys.stderr)
|
||||
# sleep for some time as a lot of crap may have happened (?)
|
||||
wait_for_hook()
|
||||
|
Loading…
Reference in New Issue
Block a user