fix race condition where moped can return before deletions are complete.

This commit is contained in:
Micah Geisel 2018-04-23 17:23:39 -07:00
parent ad901d631e
commit df330de4c8
2 changed files with 5 additions and 0 deletions

View file

@ -13,6 +13,7 @@ module DatabaseCleaner
else
collections.each { |c| session[c].find.remove_all unless @tables_to_exclude.include?(c) }
end
wait_for_removals_to_finish
true
end
@ -35,6 +36,9 @@ module DatabaseCleaner
end
end
def wait_for_removals_to_finish
session.command(getlasterror: 1)
end
end
end
end

View file

@ -21,6 +21,7 @@ module DatabaseCleaner
after(:each) do
@session.drop
@session.command(getlasterror: 1)
end
def ensure_counts(expected_counts)