summaryrefslogtreecommitdiff
path: root/tests/mini-record-failure.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-05 15:55:47 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-05 15:55:49 +0200
commita1de92b2078303625a1114c9105ea0219f14c027 (patch)
tree3e0b479d66e1010f771bd9f3f123f408e66100c9 /tests/mini-record-failure.c
parent7dff7611ec94f2573de2aa3605a29e119914f99d (diff)
downloadgnutls-a1de92b2078303625a1114c9105ea0219f14c027.tar.gz
tests: use gnutls_record_set_timeout instead of kill child processes
That way we avoid issues like #118 which are caused by killing the child process, and we also avoid deadlocks by making sure that recv will terminate after a long delay.
Diffstat (limited to 'tests/mini-record-failure.c')
-rw-r--r--tests/mini-record-failure.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/mini-record-failure.c b/tests/mini-record-failure.c
index a13e9a1063..02ce346295 100644
--- a/tests/mini-record-failure.c
+++ b/tests/mini-record-failure.c
@@ -290,6 +290,9 @@ static void server(int fd, const char *prio, int ign)
* detects an error on the peer, the main process will never know.
*/
+ /* make sure we are not blocked forever */
+ gnutls_record_set_timeout(session, 10000);
+
/* Test receiving */
do {
ret = gnutls_record_recv(session, buffer, MAX_BUF);
@@ -335,7 +338,6 @@ static void start(const char *prio, int ign)
/* parent */
close(fd[1]);
server(fd[0], prio, ign);
- kill(child, SIGTERM);
} else {
close(fd[0]);
client(fd[1], prio, ign);