Skip to content

Commit

Permalink
Fix CI failures due to domain name conflicts (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala authored Dec 13, 2024
1 parent a1c5834 commit 49e2fd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 28 deletions.
18 changes: 4 additions & 14 deletions tests/integ/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -74,20 +69,15 @@ 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 += '/'
domain += 'hsds_test'
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


Expand Down
18 changes: 4 additions & 14 deletions tests/perf/stream/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -74,20 +69,15 @@ 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 += '/'
domain += 'hsds_test'
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


Expand Down

0 comments on commit 49e2fd5

Please sign in to comment.