summaryrefslogtreecommitdiffstats
path: root/js/src/tests/lib/tasks_unix.py
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-02-02 12:00:37 -0500
committerMatt A. Tobin <email@mattatobin.com>2018-02-02 12:00:37 -0500
commitc0c702a5e3284e843e680064b4c6a7280242c567 (patch)
tree59332b13537a0c006c090ae925e8d3be50bb4699 /js/src/tests/lib/tasks_unix.py
parent45d4933f568d8814d8045852a9a1b006b912dcf7 (diff)
downloadUXP-c0c702a5e3284e843e680064b4c6a7280242c567.tar
UXP-c0c702a5e3284e843e680064b4c6a7280242c567.tar.gz
UXP-c0c702a5e3284e843e680064b4c6a7280242c567.tar.lz
UXP-c0c702a5e3284e843e680064b4c6a7280242c567.tar.xz
UXP-c0c702a5e3284e843e680064b4c6a7280242c567.zip
Use UTC where appropriate in python files
Diffstat (limited to 'js/src/tests/lib/tasks_unix.py')
-rw-r--r--js/src/tests/lib/tasks_unix.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py
index 655033522..487c749ee 100644
--- a/js/src/tests/lib/tasks_unix.py
+++ b/js/src/tests/lib/tasks_unix.py
@@ -14,7 +14,7 @@ class Task(object):
self.pid = pid
self.stdout = stdout
self.stderr = stderr
- self.start = datetime.now()
+ self.start = datetime.utcnow()
self.out = []
self.err = []
@@ -59,7 +59,7 @@ def get_max_wait(tasks, timeout):
# If a timeout is supplied, we need to wake up for the first task to
# timeout if that is sooner.
if timeout:
- now = datetime.now()
+ now = datetime.utcnow()
timeout_delta = timedelta(seconds=timeout)
for task in tasks:
remaining = task.start + timeout_delta - now
@@ -136,7 +136,7 @@ def timed_out(task, timeout):
timed_out always returns False).
"""
if timeout:
- now = datetime.now()
+ now = datetime.utcnow()
return (now - task.start) > timedelta(seconds=timeout)
return False
@@ -175,7 +175,7 @@ def reap_zombies(tasks, timeout):
''.join(ended.out),
''.join(ended.err),
returncode,
- (datetime.now() - ended.start).total_seconds(),
+ (datetime.utcnow() - ended.start).total_seconds(),
timed_out(ended, timeout)))
return tasks, finished