Skip to content

RUBY-2254 sort by id when comparing collection contents #2823

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

Merged
merged 1 commit into from
Jan 15, 2024
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
2 changes: 1 addition & 1 deletion spec/mongo/collection_crud_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2491,7 +2491,7 @@ def generate
end

let(:updated) do
authorized_collection.find.to_a.last
authorized_collection.find.sort(_id: 1).to_a.last
end

it 'reports that a document was written' do
Expand Down
2 changes: 1 addition & 1 deletion spec/mongo/operation/insert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
end

it 'inserts the documents into the collection' do
expect(authorized_collection.find.to_a). to eq(documents)
expect(authorized_collection.find.sort(_id: 1).to_a). to eq(documents)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/runners/crud.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
require 'runners/crud/verifier'

def collection_data(collection)
collection.find.to_a
collection.find.sort(_id: 1).to_a
end

def crud_execute_operations(spec, test, num_ops, event_subscriber, expect_error,
Expand Down
8 changes: 0 additions & 8 deletions spec/runners/crud/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ def setup_test(spec, client)
end
setup_fail_point(client)
end

def actual_collection_contents(client)
unless @spec.collection_name
raise ArgumentError, 'Spec does not specify a global collection'
end

client[@spec.collection_name, read_concern: {level: :majority}].find.to_a
end
end
end
end