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

Make watch mode wait for the file system to be idle, and have that be configurable #2715

Open
novemberborn opened this issue Mar 13, 2021 · 2 comments

Comments

@novemberborn
Copy link
Member

novemberborn commented Mar 13, 2021

Based on discussion in #2702, projects with more complicated build setups may want to configure how long watch mode waits for the filesystem to become idle, lest it runs tests prematurely.

~We currently wait at least 100ms, but debounce for another 10ms after changes. ~Instead let's introduce a watchFsIdle option that defaults to 500ms. This should be configurable through config files only, not CLI flags. We should take time strings, like the timeout option.

Other name suggestions welcome.

The watcher should wait the duration of idle time after the last change. If another change is detected, it should again wait the duration of the idle time.

This likely impacts the current watcher tests which are rather brittle. We also have some integration tests that may be affected.

@capttrousers
Copy link

RE new watch mode config settings, I think it'd make sense to add a new watchModeOptions top level object in the ava config object, and begin moving all existing and new watch mode options there. Watch mode seems to be a pretty specific mode for running the test runner, so having all the options for this mode in a single flat object is probably a good future proof place.

For example, if watch mode event hooks were added, to support things like clearing the screen between reruns, similar to my request here: #1623 then those could be defined in the top level watchModeOptions as well

@novemberborn
Copy link
Member Author

Watch mode has changed a lot in #3218, it'll be easier to implement this and write tests, plus there's a watchMode configuration object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants