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

problem : zdir test fails on windows/release #1609

Merged
merged 1 commit into from
Jan 21, 2017
Merged
Changes from all commits
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
22 changes: 15 additions & 7 deletions src/zdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,24 +964,30 @@ zdir_test (bool verbose)
zactor_t *watch = zactor_new (zdir_watch, NULL);
assert (watch);

int synced;
if (verbose) {
zsock_send (watch, "s", "VERBOSE");
assert (zsock_wait (watch) == 0);
synced = zsock_wait(watch);
assert ( synced == 0);
}

zclock_sleep (1001); // wait for initial file to become 'stable'

zsock_send (watch, "si", "TIMEOUT", 100);
assert (zsock_wait (watch) == 0);
synced = zsock_wait(watch);
assert (synced == 0);

zsock_send (watch, "ss", "SUBSCRIBE", "zdir-test-dir");
assert (zsock_wait (watch) == 0);
synced = zsock_wait(watch);
assert(synced == 0);

zsock_send (watch, "ss", "UNSUBSCRIBE", "zdir-test-dir");
assert (zsock_wait (watch) == 0);
synced = zsock_wait(watch);
assert(synced == 0);

zsock_send (watch, "ss", "SUBSCRIBE", "zdir-test-dir");
assert (zsock_wait (watch) == 0);
synced = zsock_wait(watch);
assert(synced == 0);

zfile_t *newfile = zfile_new ("zdir-test-dir", "test_abc");
zfile_output (newfile);
Expand All @@ -991,7 +997,8 @@ zdir_test (bool verbose)
zpoller_t *watch_poll = zpoller_new (watch, NULL);

// poll for a certain timeout before giving up and failing the test.
assert (zpoller_wait (watch_poll, 1001) == watch);
void* polled = zpoller_wait(watch_poll, 1001);
assert (polled == watch);

// wait for notification of the file being added
char *path;
Expand All @@ -1017,7 +1024,8 @@ zdir_test (bool verbose)
zfile_destroy (&newfile);

// poll for a certain timeout before giving up and failing the test.
assert (zpoller_wait (watch_poll, 1001) == watch);
polled = zpoller_wait(watch_poll, 1001);
assert (polled == watch);

// wait for notification of the file being removed
rc = zsock_recv (watch, "sp", &path, &patches);
Expand Down