1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

ctdb-tests: Removing sleep from porting_tests

This avoids test failures due to timing issues.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2016-07-27 15:21:39 +10:00 committed by Stefan Metzmacher
parent d10771cf4c
commit 9871194e86

View File

@ -158,7 +158,7 @@ static int socket_client_close(int client)
static int fork_helper(void) static int fork_helper(void)
{ {
pid_t pid; pid_t pid;
int i, client, max_rounds = 10; int client;
pid = fork(); pid = fork();
assert(pid != -1); assert(pid != -1);
@ -166,9 +166,6 @@ static int fork_helper(void)
if (pid == 0) { // Child if (pid == 0) { // Child
client = socket_client_connect(); client = socket_client_connect();
socket_client_write(client); socket_client_write(client);
for (i = 1 ; i <= max_rounds ; i++ ) {
sleep(1);
}
socket_client_close(client); socket_client_close(client);
exit(0); exit(0);
} else { } else {
@ -249,13 +246,13 @@ int main(int argc, const char *argv[])
ret = socket_server_create(); ret = socket_server_create();
assert(ret == 0); assert(ret == 0);
ret = fork_helper();
assert(ret == 0);
/* FIXME: Test tcp_checksum6, tcp_checksum */ /* FIXME: Test tcp_checksum6, tcp_checksum */
/* FIXME: Test ctdb_sys_send_arp, ctdb_sys_send_tcp */ /* FIXME: Test ctdb_sys_send_arp, ctdb_sys_send_tcp */
/* FIXME: Test ctdb_sys_{open,close}_capture_socket, ctdb_sys_read_tcp_packet */ /* FIXME: Test ctdb_sys_{open,close}_capture_socket, ctdb_sys_read_tcp_packet */
test_ctdb_sys_check_iface_exists(); test_ctdb_sys_check_iface_exists();
ret = fork_helper();
assert(ret == 0);
test_ctdb_get_peer_pid(); test_ctdb_get_peer_pid();
ret = socket_server_close(); ret = socket_server_close();