Commit 7c7ce9a
committed
fix(sync): use configured reload interval for empty-project sleep
The guard added in b38823b slept a hardcoded 30 s when no projects were
selected, which broke test_run_handles_no_projects and three sibling
reload tests:
- test_run_handles_no_projects expects the sleep to match
config.watch_project_reload_interval (the existing project-reload
cadence), not a new magic number.
- test_run_reloads_projects_each_cycle, test_run_continues_after_cycle_error,
and test_timer_task_cancelled_properly hung because they created Projects
whose names weren't registered in app_config.projects. get_project_mode()
treats unknown names as CLOUD, so _select_projects_to_watch() filtered
them all out, the guard's sleep+continue fired every iteration, and the
stubbed _watch_projects_cycle never got called.
Two fixes:
1. Sleep watch_project_reload_interval instead of 30 s, matching the
existing reload-loop cadence and honoring the existing test contract.
2. Register the test projects as local-mode in app_config.projects so
they survive the cloud filter. This aligns the reload tests with
test_run_filters_cloud_only_projects_each_cycle, which already does
this.
Signed-off-by: phernandez <paul@basicmachines.co>1 parent b38823b commit 7c7ce9a
2 files changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
| 219 | + | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
| |||
229 | 238 | | |
230 | 239 | | |
231 | 240 | | |
232 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
233 | 244 | | |
234 | 245 | | |
235 | 246 | | |
| |||
264 | 275 | | |
265 | 276 | | |
266 | 277 | | |
267 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
268 | 281 | | |
269 | 282 | | |
270 | 283 | | |
| |||
0 commit comments