diff --git a/spec/mongo/collection_crud_spec.rb b/spec/mongo/collection_crud_spec.rb index 2f26179ffc..7a5651d1d6 100644 --- a/spec/mongo/collection_crud_spec.rb +++ b/spec/mongo/collection_crud_spec.rb @@ -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 diff --git a/spec/mongo/operation/insert_spec.rb b/spec/mongo/operation/insert_spec.rb index 2c15d0fef6..2a01fa6e17 100644 --- a/spec/mongo/operation/insert_spec.rb +++ b/spec/mongo/operation/insert_spec.rb @@ -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 diff --git a/spec/runners/crud.rb b/spec/runners/crud.rb index 765597bac0..b0a76b5aca 100644 --- a/spec/runners/crud.rb +++ b/spec/runners/crud.rb @@ -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, diff --git a/spec/runners/crud/test.rb b/spec/runners/crud/test.rb index 57793e23c6..ae210b584f 100644 --- a/spec/runners/crud/test.rb +++ b/spec/runners/crud/test.rb @@ -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