Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libkz: defer kvs_watch until necessary #1424

Merged
merged 15 commits into from
Apr 6, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lua/t1003-iowatcher.t: fix test error check
Problem: lua iowatcher test 5 'iowatcher returns error
correctly' fails after kvs_watch deferral change.

This test attempts to create an iowatcher on a non-directory
and expects iowatcher creation to fail.  Now that the
the lookup is no longer performed in the context of
iowatcher creation, creation succeeds.

Change the test's iowatcher callback to stop the reactor
if 'err' is non-nil.  Then change he test to run the reactor
and expect an ENOTDIR failure.
garlick committed Apr 5, 2018
commit 7ae54dbb2439208ac744f733441c4b397cc5e32f
8 changes: 6 additions & 2 deletions t/lua/t1003-iowatcher.t
Original file line number Diff line number Diff line change
@@ -17,9 +17,13 @@ dir['simpleval'] = "xxx"
dir:commit()
local iow, err = f:iowatcher {
key = "simpleval",
handler = function (iow, lines) end
handler = function (iow, lines, err)
if err then f:reactor_stop_error () end
end
}
is (iow, nil, "iowatcher returns error correctly")
local r, err = f:reactor()
is (r, nil, "reactor returned error")
is (err, "Not a directory", "error is ENOTDIR")

dir['iowatcher'] = nil
dir:commit()