Skip to content

Commit

Permalink
Don't watch the whole directory in the file watcher test
Browse files Browse the repository at this point in the history
When watching the whole test directory we'll also get some events for
the directory, and those events can come with different order depending
on the OS, so we can't rely on them. Instead, we should watch a specific
file, so we can control the order of the events.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
  • Loading branch information
llucax committed Sep 25, 2024
1 parent 127e542 commit d55f92d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_file_watcher_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def test_file_watcher(tmp_path: pathlib.Path) -> None:
number_of_writes = 0
expected_number_of_writes = 3

file_watcher = FileWatcher(paths=[str(tmp_path)])
file_watcher = FileWatcher(paths=[str(filename)])
timer = Timer(timedelta(seconds=0.1), SkipMissedAndDrift())

async for selected in select(file_watcher, timer):
Expand Down

0 comments on commit d55f92d

Please sign in to comment.