You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/05/06 22:41:13 UTC

[impala] 01/02: IMPALA-8499: avoid datetime.total_seconds() in test_insert_events

This is an automated email from the ASF dual-hosted git repository.

tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 03ab3a58df0716b1259c1067175ee096c37460c0
Author: Tim Armstrong <ta...@cloudera.com>
AuthorDate: Mon May 6 08:59:46 2019 -0700

    IMPALA-8499: avoid datetime.total_seconds() in test_insert_events
    
    This function was only added in Python 2.7.
    
    Change-Id: I8e6e556d99d07c1f559a2097fbd634bfc5eaaa52
    Reviewed-on: http://gerrit.cloudera.org:8080/13245
    Reviewed-by: Todd Lipcon <to...@apache.org>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 tests/custom_cluster/test_event_processing.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tests/custom_cluster/test_event_processing.py b/tests/custom_cluster/test_event_processing.py
index c936807..7984664 100644
--- a/tests/custom_cluster/test_event_processing.py
+++ b/tests/custom_cluster/test_event_processing.py
@@ -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
@@ -110,11 +109,11 @@ class TestEventProcessing(CustomClusterTestSuite):
     """
     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