Skip to content

Commit

Permalink
Revert "chore: use kqueue backend of notify on macOS" (#21039)
Browse files Browse the repository at this point in the history
Reverts #21028

Reason:
https://github.com/notify-rs/notify/blob/main/notify/src/kqueue.rs#L79-L81
Need to wait for the watcher thread to spawn otherwise we hit flakes

---------

Signed-off-by: Divy Srivastava <[email protected]>
  • Loading branch information
littledivy authored Nov 1, 2023
1 parent 8ea2d92 commit 8264385
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 13 deletions.
42 changes: 36 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ log = "=0.4.20"
lsp-types = "=0.94.1" # used by tower-lsp and "proposed" feature is unstable in patch releases
memmem = "0.1.1"
monch = "=0.4.3"
# Note: Do not use the "macos_fsevent" feature of notify, as it links us to CoreFoundation on macOS.
notify = { version = "=5.0.0", default-features = false, features = ["macos_kqueue"] }
notify = "=5.0.0"
num-bigint = { version = "0.4", features = ["rand"] }
once_cell = "1.17.1"
os_pipe = "=1.1.4"
Expand Down
6 changes: 5 additions & 1 deletion cli/tests/integration/shared_library_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ fn macos_shared_libraries() {
use test_util as util;

// target/release/deno:
// /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1953.1.0)
// /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1228.0.0)
// /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
// /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
const EXPECTED: [&str; 3] = [
const EXPECTED: [&str; 5] = [
"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation",
"/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices",
"/usr/lib/libiconv.2.dylib",
"/usr/lib/libSystem.B.dylib",
"/usr/lib/libobjc.A.dylib",
Expand Down
1 change: 0 additions & 1 deletion cli/tests/node_compat/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"test-fs-open.js",
"test-fs-opendir.js",
"test-fs-rmdir-recursive.js",
"test-fs-watchfile.js",
"test-fs-write-file.js",
"test-fs-write.js",
"test-http-url.parse-https.request.js",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/node_compat/test/parallel/test-fs-watchfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ if (common.isLinux || common.isOSX || common.isWindows) {
fs.writeFile(path.join(dir, 'foo.txt'), 'foo', common.mustCall((err) => {
if (err) assert.fail(err);
}));
}, 20);
}, 1);
}));
}
4 changes: 2 additions & 2 deletions cli/tests/unit/fs_events_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Deno.test({ permissions: { read: true } }, function watchFsInvalidPath() {
} else {
assertThrows(() => {
Deno.watchFs("non-existent.file");
}, Error);
}, Deno.errors.NotFound);
}
});

Expand All @@ -32,7 +32,7 @@ async function getTwoEvents(
const events = [];
for await (const event of iter) {
events.push(event);
if (events.length == 2) break;
if (events.length > 2) break;
}
return events;
}
Expand Down

0 comments on commit 8264385

Please sign in to comment.