Skip to content

Commit 717cb18

Browse files
committed
http://277898785 fix flaky tests by properly selecting ports
1 parent 698e1ce commit 717cb18

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fi
100100
docker run --rm -t --read-only --net=none \
101101
-e HOME=/tmp -e KAGGLE_DATA_PROXY_TOKEN=test-key \
102102
-e KAGGLE_USER_SECRETS_TOKEN_KEY=test-secrets-key \
103-
-e KAGGLE_URL_BASE=http://127.0.0.1:8001 \
103+
-e KAGGLE_URL_BASE=http://127.0.0.1:0 \
104104
-e KAGGLE_DATA_PROXY_URL=http://127.0.0.1:8000 \
105105
-e KAGGLE_DATA_PROXY_PROJECT=test \
106106
-e TF_FORCE_GPU_ALLOW_GROWTH=true \

tests/test_datasets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def get_response(self):
7272
threading.Thread(target=httpd.serve_forever).start()
7373

7474
try:
75+
# Make sure this server is pointed to by clients (the port may have been dynamically chosen):
76+
env.set(_KAGGLE_URL_BASE_ENV_VAR_NAME, "http://"+httpd.server_address[0]+":"+str(httpd.server_address[1]))
7577
client_func()
7678
finally:
7779
httpd.shutdown()

tests/test_user_secrets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def get_response(self):
6666
threading.Thread(target=httpd.serve_forever).start()
6767

6868
try:
69+
# Make sure this server is pointed to by clients (the port may have been dynamically chosen):
70+
env.set(_KAGGLE_URL_BASE_ENV_VAR_NAME, "http://"+httpd.server_address[0]+":"+str(httpd.server_address[1]))
6971
client_func()
7072
finally:
7173
httpd.shutdown()

tests/test_user_session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def get_response(self):
5555
threading.Thread(target=httpd.serve_forever).start()
5656

5757
try:
58+
# Make sure this server is pointed to by clients (the port may have been dynamically chosen):
59+
env.set(_KAGGLE_URL_BASE_ENV_VAR_NAME, "http://"+httpd.server_address[0]+":"+str(httpd.server_address[1]))
5860
client_func()
5961
finally:
6062
httpd.shutdown()

0 commit comments

Comments
 (0)