Skip to content

Commit

Permalink
Merge pull request #428 from kbase/dev-fix_tests_on_non_UTC_systems
Browse files Browse the repository at this point in the history
Fix tests on non-UTC systems
  • Loading branch information
bio-boris authored Dec 20, 2021
2 parents 77f1416 + e7b5115 commit a7a2d8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/execution_engine2/db/MongoUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import time
import traceback
from contextlib import contextmanager
from datetime import datetime
from typing import Dict, List
from bson.objectid import ObjectId
from mongoengine import connect, connection
Expand Down Expand Up @@ -285,7 +284,7 @@ def update_jobs_to_queued(

bulk_update_scheduler_jobs = []
bulk_update_created_to_queued = []
queue_time_now = datetime.utcnow().timestamp()
queue_time_now = time.time()
for job_id_pair in job_id_pairs:
if job_id_pair.job_id is None:
raise ValueError(
Expand Down
5 changes: 2 additions & 3 deletions test/tests_for_db/ee2_MongoUtil_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
import logging
import os
import time
import unittest
from datetime import datetime

from bson.objectid import ObjectId

Expand Down Expand Up @@ -87,8 +87,7 @@ def test_update_jobs_enmasse(self):
scheduler_ids = ["humpty", "dumpty", "alice"]
jobs_to_update = list(map(JobIdPair, job_ids, scheduler_ids))

now_ms = datetime.utcnow().timestamp()

now_ms = time.time()
self.getMongoUtil().update_jobs_to_queued(jobs_to_update)
job.reload()
job2.reload()
Expand Down

0 comments on commit a7a2d8a

Please sign in to comment.