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

Use != for mtime comparison instead of > #21036

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/collab/src/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3412,7 +3412,8 @@ async fn test_local_settings(
});
}

#[gpui::test(iterations = 10)]
// TODO(#21034): This test is flaky for some execution orders. Set iterations back to 10 once fixed.
Copy link
Contributor

@mikayla-maki mikayla-maki Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd prefer to fix this bug as part of this PR, rather than put a TODO on it, unless there's a good reason to suppress the tests (e.g. the tests disabled on Linux due font sizing inconsistencies compared to what we get on macOS )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, should probably just do the fix! Unfortunately it may be fairly involved, as it requires the effects of proto::UpdateBufferFile and proto::BufferSaved to be applied together rather than separately. I believe the effects of this would be hard to see in the UI since they are emitted at the same time.

#[gpui::test(iterations = 4)]
async fn test_buffer_conflict_after_save(
executor: BackgroundExecutor,
cx_a: &mut TestAppContext,
Expand Down
5 changes: 1 addition & 4 deletions crates/extension_host/src/extension_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,7 @@ impl ExtensionStore {
if let (Ok(Some(index_metadata)), Ok(Some(extensions_metadata))) =
(index_metadata, extensions_metadata)
{
if index_metadata
.mtime
.bad_is_greater_than(extensions_metadata.mtime)
{
if index_metadata.mtime != extensions_metadata.mtime {
extension_index_needs_rebuild = false;
}
}
Expand Down
4 changes: 1 addition & 3 deletions crates/language/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1775,9 +1775,7 @@ impl Buffer {
match file.disk_state() {
DiskState::New => false,
DiskState::Present { mtime } => match self.saved_mtime {
Some(saved_mtime) => {
mtime.bad_is_greater_than(saved_mtime) && self.has_unsaved_edits()
}
Some(saved_mtime) => mtime != saved_mtime && self.has_unsaved_edits(),
None => true,
},
DiskState::Deleted => true,
Expand Down
Loading