diff options
author | cjihrig <cjihrig@gmail.com> | 2019-05-15 13:24:08 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-05-21 10:37:14 -0400 |
commit | 46d8af5e618554fcac89e4b15bf06f81de36ef54 (patch) | |
tree | 2c4e88611012eadb6ad054513357d0b957272592 /deps/uv/test/test-fs-poll.c | |
parent | 0ca9297c3945f52325fcd08afe3fb9dfe3adf123 (diff) | |
download | android-node-v8-46d8af5e618554fcac89e4b15bf06f81de36ef54.tar.gz android-node-v8-46d8af5e618554fcac89e4b15bf06f81de36ef54.tar.bz2 android-node-v8-46d8af5e618554fcac89e4b15bf06f81de36ef54.zip |
deps: upgrade to libuv 1.29.1
Notable changes:
- uv_get_constrained_memory() has been added.
- A race condition in uv_async_send() has been fixed.
- uv_get_free_memory() and uv_get_total_memory() now read from
/proc/meminfo, which should improve correctness when called
from inside an lxc container.
- A failed assertion in uv_fs_poll_stop() has been fixed.
- A bug in MAC addresses for IP-aliases has been fixed.
Fixes: https://github.com/nodejs/node/issues/27170
Fixes: https://github.com/nodejs/node/issues/27493
PR-URL: https://github.com/nodejs/node/pull/27718
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/uv/test/test-fs-poll.c')
-rw-r--r-- | deps/uv/test/test-fs-poll.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/deps/uv/test/test-fs-poll.c b/deps/uv/test/test-fs-poll.c index e19a68780f..9dfd5fdd6a 100644 --- a/deps/uv/test/test-fs-poll.c +++ b/deps/uv/test/test-fs-poll.c @@ -37,6 +37,10 @@ static void poll_cb_fail(uv_fs_poll_t* handle, int status, const uv_stat_t* prev, const uv_stat_t* curr); +static void poll_cb_noop(uv_fs_poll_t* handle, + int status, + const uv_stat_t* prev, + const uv_stat_t* curr); static uv_fs_poll_t poll_handle; static uv_timer_t timer_handle; @@ -84,6 +88,12 @@ static void poll_cb_fail(uv_fs_poll_t* handle, ASSERT(0 && "fail_cb called"); } +static void poll_cb_noop(uv_fs_poll_t* handle, + int status, + const uv_stat_t* prev, + const uv_stat_t* curr) { +} + static void poll_cb(uv_fs_poll_t* handle, int status, @@ -259,3 +269,32 @@ TEST_IMPL(fs_poll_close_request_multi_stop_start) { MAKE_VALGRIND_HAPPY(); return 0; } + +TEST_IMPL(fs_poll_close_request_stop_when_active) { + /* Regression test for https://github.com/libuv/libuv/issues/2287. */ + uv_loop_t loop; + uv_fs_poll_t poll_handle; + + remove(FIXTURE); + + ASSERT(0 == uv_loop_init(&loop)); + + /* Set up all handles. */ + ASSERT(0 == uv_fs_poll_init(&loop, &poll_handle)); + ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb_noop, FIXTURE, 100)); + uv_run(&loop, UV_RUN_ONCE); + + /* Close the timer handle, and do not crash. */ + ASSERT(0 == uv_fs_poll_stop(&poll_handle)); + uv_run(&loop, UV_RUN_ONCE); + + /* Clean up after the test. */ + uv_close((uv_handle_t*) &poll_handle, close_cb); + uv_run(&loop, UV_RUN_ONCE); + ASSERT(close_cb_called == 1); + + ASSERT(0 == uv_loop_close(&loop)); + + MAKE_VALGRIND_HAPPY(); + return 0; +} |