[ARVADOS] updated: 1.3.0-519-g0145b3654
Git user
git at public.curoverse.com
Thu Mar 14 14:56:56 EDT 2019
Summary of changes:
services/api/test/integration/groups_test.rb | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
via 0145b3654f3af993b03719996385dedd2e803c08 (commit)
from 0e9aa62c7865f092917d3d46b0de4a3dd453b672 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 0145b3654f3af993b03719996385dedd2e803c08
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Thu Mar 14 15:56:00 2019 -0300
14966: Implements cleanup on test case teardown.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/api/test/integration/groups_test.rb b/services/api/test/integration/groups_test.rb
index 130801bd9..cf0261585 100644
--- a/services/api/test/integration/groups_test.rb
+++ b/services/api/test/integration/groups_test.rb
@@ -130,11 +130,14 @@ class NonTransactionalGroupsTest < ActionDispatch::IntegrationTest
# This is needed because nested transactions share the connection pool, so
# one thread is locked while trying to talk to the database, until the other
# one finishes.
- #
- # WARNING: Any test within this class should clean up the changes made in the
- # database to avoid state leaks to other tests!
self.use_transactional_fixtures = false
+ teardown do
+ # Explicitly reset the database after each test.
+ post '/database/reset', {}, auth(:admin)
+ assert_response :success
+ end
+
test "create request with async=true defers permissions update" do
Rails.configuration.async_permissions_update_interval = 1 # second
name = "Random group #{rand(1000)}"
@@ -149,7 +152,7 @@ class NonTransactionalGroupsTest < ActionDispatch::IntegrationTest
}, auth(:active)
assert_response 202
- # The group exists on the database, but it's not accesible yet.
+ # The group exists on the database, but it's not accessible yet.
assert_not_nil Group.find_by_name(name)
get "/arvados/v1/groups", {
filters: [["name", "=", name]].to_json,
@@ -158,7 +161,7 @@ class NonTransactionalGroupsTest < ActionDispatch::IntegrationTest
assert_response 200
assert_equal 0, json_response['items_available']
- # Wait a bit and try again
+ # Wait a bit and try again.
sleep(1)
get "/arvados/v1/groups", {
filters: [["name", "=", name]].to_json,
@@ -166,8 +169,5 @@ class NonTransactionalGroupsTest < ActionDispatch::IntegrationTest
}, auth(:active)
assert_response 200
assert_equal 1, json_response['items_available']
-
- # Clean up after ourselves
- Group.find_by_uuid(json_response['items'][0]['uuid']).destroy
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list