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

Fix file watcher integration tests #326

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

llucax
Copy link
Contributor

@llucax llucax commented Sep 25, 2024

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. We check that if a directory event comes, it is a modification.

Also when testing for events in a file watcher, we need to set the polling_interval to a value that is small enough to detect the changes we are expecting, otherwise some events could be "merged" if the changes happen faster than the polling interval.

Fixes #324.

@llucax llucax requested a review from a team as a code owner September 25, 2024 09:47
@llucax llucax requested a review from Marenz September 25, 2024 09:47
@github-actions github-actions bot added the part:tests Affects the unit, integration and performance (benchmarks) tests label Sep 25, 2024
@llucax llucax self-assigned this Sep 25, 2024
@llucax llucax added the type:bug Something isn't working label Sep 25, 2024
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. We check that if a directory event
comes, it is a modification.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
When testing for events in a file watcher, we need to set the
`polling_interval` to a value that is small enough to detect the changes
we are expecting, otherwise some events could be "merged" if the changes
happen faster than the polling interval.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax
Copy link
Contributor Author

llucax commented Sep 25, 2024

Setting auto-merge.

@llucax llucax added this pull request to the merge queue Sep 26, 2024
Merged via the queue into frequenz-floss:v1.x.x with commit defeb7f Sep 26, 2024
14 checks passed
@llucax llucax deleted the fix-test branch September 26, 2024 08:53
@llucax llucax changed the title Don't watch the whole directory in the file watcher test Fix file watcher integration tests Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:tests Affects the unit, integration and performance (benchmarks) tests type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/test_file_watcher_integration.py became flaky after using force_polling=True
2 participants