double WTF windows
This commit is contained in:
parent
6b71939bd9
commit
f4696049cb
2
.github/workflows/integration_tests.yml
vendored
2
.github/workflows/integration_tests.yml
vendored
@ -80,7 +80,7 @@ jobs:
|
|||||||
poetry run reflex export --backend-only
|
poetry run reflex export --backend-only
|
||||||
- name: Check run --backend-only before init for counter example
|
- name: Check run --backend-only before init for counter example
|
||||||
env:
|
env:
|
||||||
WAIT_FOR_LISTENING_PORT_ARGS: --request-uri /ping
|
WAIT_FOR_LISTENING_PORT_ARGS: --path ping
|
||||||
run: |
|
run: |
|
||||||
poetry run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
|
poetry run bash scripts/integration.sh ./reflex-examples/counter dev 8001 --backend-only --backend-port 8001
|
||||||
- name: Init Website for counter example
|
- name: Init Website for counter example
|
||||||
|
@ -46,6 +46,10 @@ def _wait_for_port(port, server_pid, timeout) -> Tuple[bool, str]:
|
|||||||
|
|
||||||
def _wait_for_http_response(port, server_pid, timeout, path) -> Tuple[bool, str, str]:
|
def _wait_for_http_response(port, server_pid, timeout, path) -> Tuple[bool, str, str]:
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
if path[0] != "/":
|
||||||
|
# This is a hack for passing the path on windows without a leading slash
|
||||||
|
# which mangles it https://stackoverflow.com/a/49013604
|
||||||
|
path = "/" + path
|
||||||
url = f"http://localhost:{port}{path}"
|
url = f"http://localhost:{port}{path}"
|
||||||
print(f"Waiting for up to {timeout} seconds for {url} to return HTTP response.")
|
print(f"Waiting for up to {timeout} seconds for {url} to return HTTP response.")
|
||||||
while True:
|
while True:
|
||||||
@ -75,13 +79,17 @@ def main():
|
|||||||
parser.add_argument("port", type=int, nargs="+")
|
parser.add_argument("port", type=int, nargs="+")
|
||||||
parser.add_argument("--timeout", type=int, required=True)
|
parser.add_argument("--timeout", type=int, required=True)
|
||||||
parser.add_argument("--server-pid", type=int)
|
parser.add_argument("--server-pid", type=int)
|
||||||
parser.add_argument("--request-uri", type=str, default="/")
|
parser.add_argument("--path", type=str, default="/")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
start = time.time()
|
start = time.time()
|
||||||
executor = ThreadPoolExecutor(max_workers=len(args.port))
|
executor = ThreadPoolExecutor(max_workers=len(args.port))
|
||||||
futures = [
|
futures = [
|
||||||
executor.submit(
|
executor.submit(
|
||||||
_wait_for_http_response, p, args.server_pid, args.timeout, args.request_uri
|
_wait_for_http_response,
|
||||||
|
p,
|
||||||
|
args.server_pid,
|
||||||
|
args.timeout,
|
||||||
|
args.path,
|
||||||
)
|
)
|
||||||
for p in args.port
|
for p in args.port
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user