Skip to content

Commit

Permalink
Merge pull request #29 from atlarge-research/fzovpec/08-04-2024/serve…
Browse files Browse the repository at this point in the history
…r-test-fix

Server Timeout Fix: prevents `check.py` from checking for "Server is on" before the server gets a chance to start up and print it.
  • Loading branch information
Vlad2000Andrei authored Apr 8, 2024
2 parents 1a57baa + 29c0393 commit 504b3a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server_check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def start_server():
server_process = execute_and_detach(f'python3 {STUDENT_FILE_PATH} --address "{ADDRESS}" --port {PORT}')
expected_output = "Server is on"

output_buffer = handle_pexpect(server_process, [server_process], expected_output, "", "starting a server")
output_buffer = handle_pexpect(server_process, [server_process], expected_output, "", "starting a server", timeout=10)

return server_process, output_buffer

Expand Down Expand Up @@ -103,7 +103,7 @@ def log_in(client_name="client"):
client_process, output_buffer = start_script()
client_process.sendline(client_name)

output_buffer = handle_pexpect(client_process, [client_process], expected_output, output_buffer, "logging in with a client")
output_buffer = handle_pexpect(client_process, [client_process], expected_output, output_buffer, "logging in with a client", timeout=3)

return client_process, output_buffer

Expand Down Expand Up @@ -317,7 +317,7 @@ def __init__(self, test_func, test_id, test_msg, tags=[], max_clients=300) -> No
def execute(self, disable_colors=False):
success = True
tags_string = ' '.join(self.tags)

try:
server_process, _ = start_server()
except:
Expand Down

0 comments on commit 504b3a9

Please sign in to comment.