1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

test: remove stale UNIX socket before running test

Fixes spurious test and benchmark failures.
This commit is contained in:
Ben Noordhuis 2012-05-26 01:42:40 +02:00
parent 28766dcf55
commit 34445d0741
3 changed files with 6 additions and 9 deletions

View File

@ -19,6 +19,7 @@
* IN THE SOFTWARE.
*/
#include <stdio.h>
#include <string.h>
#include "runner.h"
@ -92,6 +93,11 @@ int run_test(const char* test, int timeout, int benchmark_output) {
main_proc = NULL;
process_count = 0;
#ifndef _WIN32
/* Clean up stale socket from previous run. */
remove(TEST_PIPENAME);
#endif
/* If it's a helper the user asks for, start it directly. */
for (task = TASKS; task->main; task++) {
if (task->is_helper && strcmp(test, task->process_name) == 0) {

View File

@ -120,11 +120,6 @@ TEST_IMPL(ipc_send_recv_pipe) {
r = uv_pipe_init(uv_default_loop(), &ctx.send.pipe, 1);
ASSERT(r == 0);
#ifndef _WIN32
/* Clean up stale socket from previous test run. */
remove(TEST_PIPENAME);
#endif
r = uv_pipe_bind(&ctx.send.pipe, TEST_PIPENAME);
ASSERT(r == 0);

View File

@ -27,10 +27,8 @@
#ifdef _WIN32
# define BAD_PIPENAME "bad-pipe"
# define UNLINK_PIPE(name)
#else
# define BAD_PIPENAME "/path/to/unix/socket/that/really/should/not/be/there"
# define UNLINK_PIPE(name) remove(name)
#endif
@ -47,8 +45,6 @@ TEST_IMPL(pipe_bind_error_addrinuse) {
uv_pipe_t server1, server2;
int r;
UNLINK_PIPE(TEST_PIPENAME);
r = uv_pipe_init(uv_default_loop(), &server1, 0);
ASSERT(r == 0);
r = uv_pipe_bind(&server1, TEST_PIPENAME);