Specification
The current Status.waitFor uses unreliable polling which may miss transition events. Any usage of poll on FS changes can result in this. this creates some flaky tests like status testing where we want to test for when the agent is in STOPPING status.
File watching interface would be more robust and would be a reactive interface, where the OS notifies nodejs about a file change. This should improve our test robustness, and in some cases improve our speeds where poll is being used.
Additional context
Tasks
- Research the different OS file watching interfaces
- Use
fs.watch or chokidar https://github.com/paulmillr/chokidar, the fs.watch may be more simpler for this particular usecase, and better than bringing potentially another buggy library, and one that may not work on Android or iOS
- Replace our testing with
poll with fs.watch
- Update our status tests to be capable of properly testing
STOPPING
Specification
The current
Status.waitForuses unreliable polling which may miss transition events. Any usage ofpollon FS changes can result in this. this creates some flaky tests like status testing where we want to test for when the agent is inSTOPPINGstatus.File watching interface would be more robust and would be a reactive interface, where the OS notifies nodejs about a file change. This should improve our test robustness, and in some cases improve our speeds where
pollis being used.Additional context
Tasks
fs.watchor chokidar https://github.com/paulmillr/chokidar, thefs.watchmay be more simpler for this particular usecase, and better than bringing potentially another buggy library, and one that may not work on Android or iOSpollwithfs.watchSTOPPING