Date: Mon, 10 Feb 2020 09:09:57 +0000 (UTC) From: Peter Holm <pho@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r357724 - user/pho/stress2/misc Message-ID: <202002100909.01A99v8x066512@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pho Date: Mon Feb 10 09:09:57 2020 New Revision: 357724 URL: https://svnweb.freebsd.org/changeset/base/357724 Log: Added timeout(1) to this test. Modified: user/pho/stress2/misc/sem_wait.sh Modified: user/pho/stress2/misc/sem_wait.sh ============================================================================== --- user/pho/stress2/misc/sem_wait.sh Mon Feb 10 09:01:54 2020 (r357723) +++ user/pho/stress2/misc/sem_wait.sh Mon Feb 10 09:09:57 2020 (r357724) @@ -56,6 +56,8 @@ static sem_t *semaphore; static void * test(void) { + setproctitle("%s", __func__); + alarm(300); for (;;) { if (sem_wait(semaphore) == -1) err(1, "sem_wait"); @@ -70,6 +72,8 @@ main(void) { size_t len; time_t start; + setproctitle("%s", __func__); + alarm(300); len = PAGE_SIZE; if ((semaphore = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED) @@ -101,6 +105,7 @@ main(void) { } EOF mycc -o /tmp/sem_wait -Wall -Wextra -O2 /tmp/sem_wait.c || exit 1 -/tmp/sem_wait; s=$? +timeout 6m /tmp/sem_wait; s=$? +[ $s -eq 124 ] && echo "Timed out" rm -f /tmp/sem_wait /tmp/sem_wait.c exit $s
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002100909.01A99v8x066512>