From 49e2fd51f8e9526938b31671228ea9cd3c62e17a Mon Sep 17 00:00:00 2001 From: Matt L <124107509+mattjala@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:37:53 -0600 Subject: [PATCH] Fix CI failures due to domain name conflicts (#408) --- tests/integ/helper.py | 18 ++++-------------- tests/perf/stream/helper.py | 18 ++++-------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/tests/integ/helper.py b/tests/integ/helper.py index e7d1ee09..3eb63ecd 100644 --- a/tests/integ/helper.py +++ b/tests/integ/helper.py @@ -13,14 +13,9 @@ import requests_unixsocket import json import os.path as op -from datetime import datetime -import time +import random +import string import base64 -try: - import pytz - USE_UTC = True -except ModuleNotFoundError: - USE_UTC = False import config @@ -74,11 +69,6 @@ def getActiveNodeCount(session=None): def getTestDomainName(name): """Get base domain to use for test_cases""" - now = time.time() - if USE_UTC: - dt = datetime.fromtimestamp(now, pytz.utc) - else: - dt = datetime.fromtimestamp(now) domain = "/home/" domain += config.get('user_name') domain += '/' @@ -86,8 +76,8 @@ def getTestDomainName(name): domain += '/' domain += name.lower() domain += '/' - domain += "{:04d}{:02d}{:02d}T{:02d}{:02d}{:02d}_{:06d}Z".format( - dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond) + random_str = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)) + domain += random_str return domain diff --git a/tests/perf/stream/helper.py b/tests/perf/stream/helper.py index 15cece55..13f19f7f 100644 --- a/tests/perf/stream/helper.py +++ b/tests/perf/stream/helper.py @@ -13,14 +13,9 @@ import requests_unixsocket import json import os.path as op -from datetime import datetime -import time +import random +import string import base64 -try: - import pytz - USE_UTC = True -except ModuleNotFoundError: - USE_UTC = False import config @@ -74,11 +69,6 @@ def getActiveNodeCount(session=None): def getTestDomainName(name): """Get base domain to use for test_cases""" - now = time.time() - if USE_UTC: - dt = datetime.fromtimestamp(now, pytz.utc) - else: - dt = datetime.fromtimestamp(now) domain = "/home/" domain += config.get('user_name') domain += '/' @@ -86,8 +76,8 @@ def getTestDomainName(name): domain += '/' domain += name.lower() domain += '/' - domain += "{:04d}{:02d}{:02d}T{:02d}{:02d}{:02d}_{:06d}Z".format( - dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond) + random_str = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)) + domain += random_str return domain