diff options
author | Florian Diebold <[email protected]> | 2021-02-12 14:58:29 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-02-12 15:31:16 +0000 |
commit | a7387cae2ca9d5e114246e6fada98bfe7808e1d0 (patch) | |
tree | db0fe8d939afaa10929debf317be670f79909c9f /crates/vfs-notify/src | |
parent | dee5aba43a1b45131bf31268431fa71923f2ef2a (diff) |
Fix slow tests sometimes failing
In some situations we reloaded the workspace in the tests after having reported
to be ready. There's two fixes here:
1. Add a version to the VFS config and include that version in progress reports,
so that we don't think we're done prematurely;
2. Delay status transitions until after changes are applied. Otherwise the last
change during loading can potentially trigger a workspace reload, if it contains
interesting changes.
Diffstat (limited to 'crates/vfs-notify/src')
-rw-r--r-- | crates/vfs-notify/src/lib.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index c605bcf3c..f7ae0577d 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs | |||
@@ -86,8 +86,10 @@ impl NotifyActor { | |||
86 | self.watcher = watcher.map(|it| (it, watcher_receiver)); | 86 | self.watcher = watcher.map(|it| (it, watcher_receiver)); |
87 | } | 87 | } |
88 | 88 | ||
89 | let config_version = config.version; | ||
90 | |||
89 | let n_total = config.load.len(); | 91 | let n_total = config.load.len(); |
90 | self.send(loader::Message::Progress { n_total, n_done: 0 }); | 92 | self.send(loader::Message::Progress { n_total, n_done: 0, config_version }); |
91 | 93 | ||
92 | self.watched_entries.clear(); | 94 | self.watched_entries.clear(); |
93 | 95 | ||
@@ -98,7 +100,11 @@ impl NotifyActor { | |||
98 | } | 100 | } |
99 | let files = self.load_entry(entry, watch); | 101 | let files = self.load_entry(entry, watch); |
100 | self.send(loader::Message::Loaded { files }); | 102 | self.send(loader::Message::Loaded { files }); |
101 | self.send(loader::Message::Progress { n_total, n_done: i + 1 }); | 103 | self.send(loader::Message::Progress { |
104 | n_total, | ||
105 | n_done: i + 1, | ||
106 | config_version, | ||
107 | }); | ||
102 | } | 108 | } |
103 | } | 109 | } |
104 | Message::Invalidate(path) => { | 110 | Message::Invalidate(path) => { |