Skip to content

Commit

Permalink
Add edenfs specific file watcher tests
Browse files Browse the repository at this point in the history
Summary:
# Context

We are introducing EdenFS notifications to support scalable and ergonomic file system notifications for EdenFS mounts.

# This Diff

* Adds additional edenfs specific file watcher tests.
* We would like to test remount/restart, but that leaves the test in bad state when running on an eden mount.

# Next Steps

* Fix bug in EdenFS that causes `to` and `from` to be switched in commit transitions.
* After fix deployed - remove work around in edenfs file watcher.

Differential Revision: D67614187

fbshipit-source-id: a51b5c5ec630670489e83e1c4af33ca05e4d69ca
  • Loading branch information
jdelliot authored and facebook-github-bot committed Dec 24, 2024
1 parent 1f3f676 commit 8b51597
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/core/io/test_edenfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@

# pyre-strict

from buck2.tests.core.common.io.file_watcher import FileWatcherProvider
import subprocess

from buck2.tests.core.common.io.file_watcher import (
FileWatcherProvider,
get_file_watcher_events,
)
from buck2.tests.core.common.io.file_watcher_dir_tests import (
run_create_directory_test,
run_remove_directory_test,
Expand All @@ -26,7 +31,10 @@
run_rebase_wtih_mergebase_test,
run_restack_wtih_mergebase_test,
)
from buck2.tests.core.common.io.file_watcher_tests import FileSystemType
from buck2.tests.core.common.io.file_watcher_tests import (
FileSystemType,
setup_file_watcher_test,
)

from buck2.tests.e2e_util.api.buck import Buck
from buck2.tests.e2e_util.buck_workspace import buck_test
Expand Down Expand Up @@ -115,3 +123,12 @@ async def test_edenfs_restack_with_mergebase(buck: Buck) -> None:
await run_restack_wtih_mergebase_test(
buck, FileSystemType.EDEN_FS, FileWatcherProvider.EDEN_FS
)


@buck_test(setup_eden=True)
async def test_edenfs_truncate_journal(buck: Buck) -> None:
await setup_file_watcher_test(buck)
subprocess.run(["edenfsctl", "debug", "flush_journal"], cwd=buck.cwd)

is_fresh_instance, _ = await get_file_watcher_events(buck)
assert is_fresh_instance

0 comments on commit 8b51597

Please sign in to comment.