Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/endpointsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ void *create_receiver_sync_socket(void *ptr)
struct ntttcp_test *test = tep->test;
struct ntttcp_stream_server *ss;

int sync_listener = 0;
int answer_to_send = 0; /* the int to be sent */
int converted = 0;
int request_received = 0; /* the int to be received */
Expand All @@ -307,8 +306,9 @@ void *create_receiver_sync_socket(void *ptr)
ss->server_port = test->server_base_port - 1;
ss->protocol = TCP; /* no matter what test will be executed, the synch thread always uses TCP */
ss->listener = ntttcp_server_listen(ss);
if (sync_listener == -1) {
if (ss->listener == -1) {
PRINT_ERR("receiver: failed to listen on sync port");
free(ss);
return NULL;
Comment thread
lokeshmuthuraj marked this conversation as resolved.
}
Comment thread
lokeshmuthuraj marked this conversation as resolved.

Expand Down Expand Up @@ -360,7 +360,7 @@ void *create_receiver_sync_socket(void *ptr)
break;

/* we are notified by epoll_wait() */
n_fds = epoll_wait(efd, events, ss->max_fd + 1, -1);
n_fds = epoll_wait(efd, events, MAX_EPOLL_EVENTS, 1000);
if (n_fds < 0 && errno != EINTR) {
ASPRINTF(&log, "error happened when epoll_wait(), errno=%d, n_fds=%d", errno, n_fds);
PRINT_ERR_FREE(log);
Expand Down
14 changes: 7 additions & 7 deletions test/functional_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def combine_command(
sender_cmd = f"{sender_cmd} {sender_option}"
return receiver_cmd, sender_cmd

def setup(self):
def setup_method(self, method):
time.sleep(1)
print("\n")

def teardown(self):
def teardown_method(self, method):
subprocess.run("killall ntttcp", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
Comment thread
lokeshmuthuraj marked this conversation as resolved.

def test_daemon(self) -> None:
Expand Down Expand Up @@ -97,7 +97,7 @@ def test_multi_port_threads(self) -> None:
throughput = parse_result.get_throughput_Gbps()
assert throughput >= self.expected_throughput

def test_running_with_warmup_cooldowm_time(self) -> None:
def test_running_with_warmup_cooldown_time(self) -> None:
set_warmup_time = 3
set_cooldown_time = 4
common_option = f"-W {set_warmup_time} -C {set_cooldown_time}"
Expand Down Expand Up @@ -179,13 +179,13 @@ def test_starting_port_number(self) -> None:
assert throughput >= self.expected_throughput

def test_mapping_option(self) -> None:
ports = 200
defualt_threads = 4
receiver_cmd = f"ulimit -n 10240 && ./src/ntttcp -D -r -m {ports},*,{self.loopback_interface} -D -t 5"
ports = 50
default_threads = 4
receiver_cmd = f"ulimit -n 10240 && ./src/ntttcp -D -r -m {ports},*,{self.loopback_interface} -t 5"
sender_cmd = f"ulimit -n 10240 && ./src/ntttcp -s{self.loopback_interface} -P {ports} -t 5"
result = self.run_test(receiver_cmd, sender_cmd)
parse_result = ntttcp_output.NtttcpOutput(result.receiver_stdout, result.sender_stdout)
assert parse_result.get_ports_numbers() == ports * defualt_threads
assert parse_result.get_ports_numbers() == ports * default_threads
throughput = parse_result.get_throughput_Gbps()
assert throughput >= self.expected_throughput

Expand Down
Loading