mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
fix race condition where moped can return before deletions are complete.
This commit is contained in:
parent
ad901d631e
commit
df330de4c8
2 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -21,6 +21,7 @@ module DatabaseCleaner
|
|||
|
||||
after(:each) do
|
||||
@session.drop
|
||||
@session.command(getlasterror: 1)
|
||||
end
|
||||
|
||||
def ensure_counts(expected_counts)
|
||||
|
|
Loading…
Reference in a new issue