Skip to content
Merged
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
11 changes: 6 additions & 5 deletions dotnet/test/E2E/RpcAdditionalEdgeCasesE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public async Task Permissions_SetApproveAll_Toggle_Round_Trips()
}

[Fact]
public async Task Workspaces_CreateFile_Then_ListFiles_Returns_Sorted_Or_Stable_Order()
public async Task Workspaces_CreateFile_Then_ListFiles_Returns_All_Files()
{
var session = await CreateSessionAsync();
var prefix = $"order-{Guid.NewGuid():N}-";
Expand All @@ -204,15 +204,16 @@ public async Task Workspaces_CreateFile_Then_ListFiles_Returns_Sorted_Or_Stable_
.Where(path => path.StartsWith(prefix, StringComparison.Ordinal))
.ToList();

// The files this test created should be returned in sorted order.
Assert.Equal(paths, matchingFiles);
// The files this test created should all be returned; the runtime does not guarantee
// that workspace file enumeration is sorted.
Assert.Equal(paths, matchingFiles.OrderBy(path => path, StringComparer.Ordinal));

// Calling list again immediately must preserve the same order.
// A repeated list should still include the files regardless of returned order.
var listed2 = await session.Rpc.Workspaces.ListFilesAsync();
var matchingFiles2 = listed2.Files
.Where(path => path.StartsWith(prefix, StringComparison.Ordinal))
.ToList();
Assert.Equal(matchingFiles, matchingFiles2);
Assert.Equal(paths, matchingFiles2.OrderBy(path => path, StringComparer.Ordinal));
}

[Fact]
Expand Down
11 changes: 6 additions & 5 deletions rust/tests/e2e/rpc_additional_edge_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ async fn permissions_set_approve_all_toggle_round_trips() {
}

#[tokio::test]
async fn workspaces_createfile_then_listfiles_returns_sorted_or_stable_order() {
async fn workspaces_createfile_then_listfiles_returns_all_files() {
with_e2e_context(
"rpc_additional_edge_cases",
"workspaces_createfile_then_listfiles_returns_sorted_or_stable_order",
"workspaces_createfile_then_listfiles_returns_all_files",
|ctx| {
Box::pin(async move {
ctx.set_default_copilot_user();
Expand Down Expand Up @@ -465,9 +465,10 @@ async fn workspaces_createfile_then_listfiles_returns_sorted_or_stable_order() {
.list_files()
.await
.expect("list files again");
assert_eq!(first.files, second.files);
for expected in ["a-rust.txt", "b-rust.txt", "c-rust.txt"] {
assert!(first.files.iter().any(|file| file == expected));
for files in [&first.files, &second.files] {
for expected in ["a-rust.txt", "b-rust.txt", "c-rust.txt"] {
assert!(files.iter().any(|file| file == expected));
}
}

session.disconnect().await.expect("disconnect session");
Expand Down
Loading