Skip to content

Commit

Permalink
IMPALA-8499: avoid datetime.total_seconds() in test_insert_events
Browse files Browse the repository at this point in the history
This function was only added in Python 2.7.

Change-Id: I8e6e556d99d07c1f559a2097fbd634bfc5eaaa52
Reviewed-on: http://gerrit.cloudera.org:8080/13245
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-on: https://gerrit.sjc.cloudera.com/c/cdh/impala/+/49695
CDH-Build: Vihang Karajgaonkar <vihang@cloudera.com>
Reviewed-by: Vihang Karajgaonkar <vihang@cloudera.com>
Quasar-L0: Vihang Karajgaonkar <vihang@cloudera.com>
Tested-by: Vihang Karajgaonkar <vihang@cloudera.com>
  • Loading branch information
timarmstrong authored and Vihang Karajgaonkar committed Jun 21, 2019
1 parent 4bde09c commit b018eed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/custom_cluster/test_event_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import pytest
import json
import time
from datetime import datetime
from tests.common.environ import build_flavor_timeout
import requests
from tests.common.skip import SkipIfS3, SkipIfABFS, SkipIfADLS, SkipIfIsilon, SkipIfLocal
Expand Down Expand Up @@ -110,11 +109,11 @@ def wait_for_insert_event_processing(self, previous_event_id):
"""
new_event_id = self.get_last_synced_event_id()
success = True
start_time = datetime.now()
start_time = time.time()
while new_event_id - previous_event_id < 2:
new_event_id = self.get_last_synced_event_id()
# Prevent infinite loop
time_delta = (datetime.now() - start_time).total_seconds()
time_delta = time.time() - start_time
if time_delta > 10:
success = False
break
Expand Down

0 comments on commit b018eed

Please sign in to comment.