Skip to content

Fix more test flakiness#60

Merged
as-cii merged 3 commits intomasterfrom
fix-failures
May 13, 2021
Merged

Fix more test flakiness#60
as-cii merged 3 commits intomasterfrom
fix-failures

Conversation

@as-cii
Copy link
Member

@as-cii as-cii commented May 13, 2021

This pull request is an improvement over #59 and attempts to fix some of the flakiness related to Worktree and file system changes in general. It does so in a couple of ways:

  • When the worktree changes, models like Buffer will need to recompute some internal state (possibly asynchronously) and then update themselves. This may or may not happen in the same tick of the loop as the Worktree change, so we can't rely on Worktree having changed to assert conditions on upstream models that depend on it. This is achieved in 19f51bc and 37f0ba9, where we rely more on the condition helper to wait for derived state to get updated.
  • There was another source of flakiness due to reloading the buffer and updating its saved_mtime/saved_version at two different moments. 4884a05 addresses this by computing the diff in a background thread, but incorporating it and updating FileHandle-related metadata (such as saved_mtime) atomically.
  • Note that, as part of this pull request, we are also getting rid of next_scan_complete as there is no place in the codebase that uses it at the moment and it's probably detrimental to keep it around, as it invites a bad usage that introduces unexpected flakiness.

Async keeps being hard.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant