From ae1f6fd03a26a0ef4b3aaf6a6b7cedadfa1776f1 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Fri, 2 Dec 2016 00:55:02 -0500 Subject: [PATCH] fs: re-enable watch facility in AIX On AIX, watch feature depends on AHAFS based Event infrastructure. While in principle the watch use case is same across platforms, there are subtle differences in the way AIX deals with this, with few behavioral changes (external). This commit addresses an assertion failure on folder watch, enabling the AIX code for watch feature which was masked under a macro, open up relevant test cases, skip tests which comes under the AIX limitation, and make the document changes as appropriate. Refs: https://github.com/nodejs/node/pull/11094 Refs: https://github.com/nodejs/node/issues/5085 PR-URL: https://github.com/nodejs/node/pull/10085 Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Santiago Gimeno --- doc/api/fs.md | 7 +++++++ test/parallel/parallel.status | 9 +-------- test/parallel/test-fs-watch-encoding.js | 9 +++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 461917b85d7488..3594b3812e6b62 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1752,6 +1752,13 @@ a new inode. The watch will emit an event for the delete but will continue watching the *original* inode. Events for the new inode will not be emitted. This is expected behavior. +In AIX, save and close of a file being watched causes two notifications - +one for adding new content, and one for truncation. Moreover, save and +close operations on some platforms cause inode changes that force watch +operations to become invalid and ineffective. AIX retains inode for the +lifetime of a file, that way though this is different from Linux / OS X, +this improves the usability of file watching. This is expected behavior. + #### Filename Argument diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 9acedf015f9e9e..5b84bb1a250ee2 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -19,14 +19,7 @@ test-debug-signal-cluster : PASS,FLAKY [$system==freebsd] -# fs-watch currently needs special configuration on AIX and we -# want to improve under https://github.com/nodejs/node/issues/5085. -# Tests are disabled so CI can be green and we can spot other -# regressions until this work is complete [$system==aix] -test-fs-watch-enoent : FAIL, PASS -test-fs-watch-encoding : FAIL, PASS - #covered by https://github.com/nodejs/node/issues/3796 # but more frequent on AIX ? -test-debug-signal-cluster : PASS, FLAKY +test-debug-signal-cluster : PASS, FLAKY \ No newline at end of file diff --git a/test/parallel/test-fs-watch-encoding.js b/test/parallel/test-fs-watch-encoding.js index f17ed7c30a19a4..04f5ffaad97a97 100644 --- a/test/parallel/test-fs-watch-encoding.js +++ b/test/parallel/test-fs-watch-encoding.js @@ -14,6 +14,15 @@ const common = require('../common'); const fs = require('fs'); const path = require('path'); +// fs-watch on folders have limited capability in AIX. +// The testcase makes use of folder watching, and causes +// hang. This behavior is documented. Skip this for AIX. + +if (common.isAix) { + common.skip('folder watch capability is limited in AIX.'); + return; +} + common.refreshTmpDir(); const fn = '新建文夹件.txt';