X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e9e39b5f92ec9a702f2bbdd815dd3a1942820db9..7a5a0ef9eb13312b2ee8b0b3731dbddb4de7b669:/services/api/test/functional/sys_controller_test.rb diff --git a/services/api/test/functional/sys_controller_test.rb b/services/api/test/functional/sys_controller_test.rb index 7f9c67afdc..c3f13cf4b8 100644 --- a/services/api/test/functional/sys_controller_test.rb +++ b/services/api/test/functional/sys_controller_test.rb @@ -159,12 +159,16 @@ class SysControllerTest < ActionController::TestCase # uuid_active row shouldn't get deleted. sleep 10 rescue + # Unblock main thread ready << false + raise end end assert_equal true, ready.pop authorize_with :admin post :trash_sweep - assert_equal [[uuid_active]], ActiveRecord::Base.connection.exec_query("SELECT uuid FROM uuid_locks ORDER BY uuid", "", []).rows + rows = ActiveRecord::Base.connection.exec_query("SELECT uuid FROM uuid_locks ORDER BY uuid", "", []).rows + assert_includes(rows, [uuid_active], "row with active lock (still held by thread) should not have been deleted") + refute_includes(rows, [uuid_inactive], "row with inactive lock should have been deleted") end end