Skip to content

Commit bf068e7

Browse files
committed
TUN-4504: Fix component tests in windows
1 parent f887322 commit bf068e7

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

component-tests/test_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Rolling logger rotate log files after 1 MB
88
rotate_after_size = 1000 * 1000
99
default_log_file = "cloudflared.log"
10-
expect_message = "Starting Hello World server"
10+
expect_message = "Starting Hello"
1111

1212

1313
def assert_log_to_terminal(cloudflared):

component-tests/test_reconnect.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99

1010
@flaky(max_runs=3, min_passes=1)
11-
class TestReconnect():
11+
class TestReconnect:
1212
default_ha_conns = 4
13-
default_reconnect_secs = 5
13+
default_reconnect_secs = 15
1414
extra_config = {
1515
"stdin-control": True,
1616
}
@@ -36,19 +36,17 @@ def send_reconnect(self, cloudflared, secs):
3636
cloudflared.stdin.flush()
3737

3838
def assert_reconnect(self, config, cloudflared, repeat):
39-
wait_tunnel_ready(tunnel_url=config.get_url())
39+
wait_tunnel_ready(tunnel_url=config.get_url(), require_min_connections=self.default_ha_conns)
4040
for _ in range(repeat):
4141
for i in range(self.default_ha_conns):
4242
self.send_reconnect(cloudflared, self.default_reconnect_secs)
4343
expect_connections = self.default_ha_conns-i-1
4444
if expect_connections > 0:
4545
# Don't check if tunnel returns 200 here because there is a race condition between wait_tunnel_ready
4646
# retrying to get 200 response and reconnecting
47-
wait_tunnel_ready(
48-
require_min_connections=expect_connections)
47+
wait_tunnel_ready(require_min_connections=expect_connections)
4948
else:
5049
check_tunnel_not_connected()
5150

52-
sleep(self.default_reconnect_secs + 10)
53-
wait_tunnel_ready(tunnel_url=config.get_url(),
54-
require_min_connections=self.default_ha_conns)
51+
sleep(self.default_reconnect_secs * 2)
52+
wait_tunnel_ready(tunnel_url=config.get_url(), require_min_connections=self.default_ha_conns)

component-tests/util.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def cloudflared_cmd(config, config_path, cfd_args, cfd_pre_args, root):
3434
cmd += ["sudo"]
3535
cmd += [config.cloudflared_binary]
3636
cmd += cfd_pre_args
37-
cmd += ["--config", config_path]
37+
cmd += ["--config", str(config_path)]
3838
cmd += cfd_args
3939
LOGGER.info(f"Run cmd {cmd} with config {config}")
4040
return cmd
@@ -50,8 +50,7 @@ def run_cloudflared_background(cmd, allow_input, capture_output):
5050
finally:
5151
cfd.terminate()
5252
if capture_output:
53-
LOGGER.info(
54-
f"cloudflared log: {cfd.stderr.read()}")
53+
LOGGER.info(f"cloudflared log: {cfd.stderr.read()}")
5554

5655

5756
@retry(stop_max_attempt_number=MAX_RETRIES, wait_fixed=BACKOFF_SECS * 1000)

0 commit comments

Comments
 (0)