21703: Improve test failure reporting.
authorTom Clegg <tom@curii.com>
Mon, 24 Jun 2024 18:43:46 +0000 (14:43 -0400)
committerTom Clegg <tom@curii.com>
Mon, 24 Jun 2024 18:43:46 +0000 (14:43 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/api/test/functional/sys_controller_test.rb

index 88603cbc2d49f00968f52fcbdfd13ba1cf4f21fe..c3f13cf4b8e575b7f4cc088e011585a6cbc53c11 100644 (file)
@@ -167,6 +167,8 @@ class SysControllerTest < ActionController::TestCase
     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