Skip to content

Commit 0613e1e

Browse files
committed
CMR-11368: adding more sync and tweeking time to lower chance of hitting the other testing threads
1 parent 5d37956 commit 0613e1e

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

access-control-app/int-test/cmr/access_control/int_test/acl_search_test.clj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
(fixtures/grant-all-acl-fixture))
2121
(use-fixtures :once (fixtures/int-test-fixtures))
2222

23-
(deftest invalid-search-test
23+
(deftest ^:serial invalid-search-test
2424
(testing "Accept header"
2525
(testing "Other than JSON is rejected"
2626
(is (= {:status 400
@@ -59,7 +59,7 @@
5959
[{} 0]
6060
(partition 2 group-permissions))))
6161

62-
(deftest acl-search-order-test
62+
(deftest ^:serial acl-search-order-test
6363
;; Conforms to requirements set out in CMR-3590, alphabetical order regardless of case
6464
(let [token (e/login (u/conn-context) "user1")
6565
acl1 (u/ingest-acl token {:group_permissions [{:user_type "registered" :permissions ["read"]}]
@@ -85,7 +85,7 @@
8585
"System - GROUP"]
8686
(map :name (:items (ac/search-for-acls (merge {:token token} (u/conn-context)) {})))))))
8787

88-
(deftest acl-search-permission-test
88+
(deftest ^:serial acl-search-permission-test
8989
(let [_token (e/login (u/conn-context) "user1")
9090
admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
9191
group1 (u/ingest-group admin-token
@@ -164,7 +164,7 @@
164164
(is (= (u/acls->search-response 1 [acl7])
165165
(dissoc response :took)))))))
166166

167-
(deftest acl-search-test
167+
(deftest ^:serial acl-search-test
168168
(let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
169169
group1 (u/ingest-group admin-token
170170
{:name "group1"}
@@ -271,7 +271,7 @@
271271
{:page_size 3 :page_num 2}
272272
{:token admin-token}) :took))))))
273273

274-
(deftest acl-search-by-any-id-test
274+
(deftest ^:serial acl-search-by-any-id-test
275275
(let [token (e/login (u/conn-context) "user1")
276276
acl1 (u/ingest-acl token (u/catalog-item-acl "All Collections"))
277277
acl2 (u/ingest-acl token (u/catalog-item-acl "All Granules"))
@@ -297,7 +297,7 @@
297297
(:concept-id acl2)
298298
"acl3-legacy-guid"]})))
299299

300-
(deftest acl-search-permitted-group-test
300+
(deftest ^:serial acl-search-permitted-group-test
301301
(declare group-permissions acls query-map)
302302
(u/without-publishing-messages
303303
(let [token (e/login (u/conn-context) "user1")
@@ -456,7 +456,7 @@
456456
:content-type :json}
457457
(ac/search-for-acls (u/conn-context) query {:token token :raw? true}))))))))
458458

459-
(deftest acl-search-by-identity-type-test
459+
(deftest ^:serial acl-search-by-identity-type-test
460460
(declare identity-types expected-acls)
461461
(let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
462462
group1 (u/ingest-group admin-token
@@ -505,7 +505,7 @@
505505
"Identity type searches are always case-insensitive"
506506
["PrOvIdEr"] (concat [fixtures/*fixture-provider-acl*] provider-group-acls)))))
507507

508-
(deftest acl-search-by-target-test
508+
(deftest ^:serial acl-search-by-target-test
509509
(declare target)
510510
(let [token (e/login (u/conn-context) "user1")
511511
single-instance-acl (u/ingest-acl token
@@ -529,7 +529,7 @@
529529
"Provider target, case insensitive"
530530
["catalog_item_acl"] [fixtures/*fixture-provider-acl*])))
531531

532-
(deftest acl-search-by-permitted-user-test
532+
(deftest ^:serial acl-search-by-permitted-user-test
533533
(declare user users)
534534
(let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
535535
group1 (u/ingest-group admin-token {:name "group1"} ["user1"])
@@ -593,7 +593,7 @@
593593
"User names are case-insensitive"
594594
["USER1"] [fixtures/*fixture-system-acl* fixtures/*fixture-provider-acl* acl-registered-1 acl-registered-2 acl-group1 acl-group2]))))
595595

596-
(deftest acl-search-provider-test
596+
(deftest ^:serial acl-search-provider-test
597597
(declare options provider-ids)
598598
(let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
599599
group1 (u/ingest-group admin-token {:name "group1"} ["user1"])
@@ -675,7 +675,7 @@
675675
"Multiple providers with empty results using ignore_case=false option"
676676
["prov1"] {"options[provider][ignore_case]" false} []))))
677677

678-
(deftest acl-search-multiple-criteria
678+
(deftest ^:serial acl-search-multiple-criteria
679679
(let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
680680
group1 (u/ingest-group admin-token {:name "group1"} ["user1"])
681681
group2 (u/ingest-group admin-token {:name "group2"} ["user2"])
@@ -743,7 +743,7 @@
743743
:permitted-user "user2"}
744744
[acl3 fixtures/*fixture-provider-acl* acl5 acl7]))))
745745

746-
(deftest acl-search-with-legacy-group-guid-test
746+
(deftest ^:serial acl-search-with-legacy-group-guid-test
747747
(let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
748748
group1-legacy-guid "group1-legacy-guid"
749749
group1 (u/ingest-group admin-token
@@ -804,7 +804,7 @@
804804
(is (= (u/acls->search-response (count expected-acls) expected-acls {:include-full-acl true})
805805
(dissoc response :took)))))))
806806

807-
(deftest acl-reindexing-test
807+
(deftest ^:serial acl-reindexing-test
808808
(u/without-publishing-messages
809809
(let [token (e/login (u/conn-context) "user1")
810810
acl1 (u/ingest-acl token (assoc (u/system-acl "METRIC_DATA_POINT_SAMPLE")
@@ -850,7 +850,7 @@
850850
(count expected-acls-after-reindexing) expected-acls-after-reindexing)))
851851
(set (:items actual-response))))))))
852852

853-
(deftest acl-search-by-target-group-id-test
853+
(deftest ^:serial acl-search-by-target-group-id-test
854854
(let [admin-token (e/login (u/conn-context) "admin" ["AG1200000000-CMR"])
855855
group1 (u/ingest-group admin-token
856856
{:name "group1"}

access-control-app/int-test/cmr/access_control/int_test/enable_disable_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
;; disable writes for access control service
6565
(u/disable-access-control-writes post-options)
66-
(Thread/sleep 5000)
66+
(Thread/sleep 1000)
6767

6868
(testing "save, update, and delete acl fails after disable"
6969
(try
@@ -77,7 +77,7 @@
7777
(finally
7878
;; always re-enable writes for access control service
7979
(u/enable-access-control-writes post-options)
80-
(Thread/sleep 5000))))
80+
(Thread/sleep 1000))))
8181

8282
(testing "save, upate, and delete acl works after re-enable"
8383
(let [resp (ac/create-acl (u/conn-context) system-acl {:raw? true :token token})]
@@ -121,7 +121,7 @@
121121
(finally
122122
;; Allways re-eneable writes for access control service, even if there was an exception
123123
(u/enable-access-control-writes post-options)
124-
(Thread/sleep 5000))))
124+
(Thread/sleep 1000))))
125125

126126
(testing "save, update, and delete group succeeds after re-enable"
127127
(let [group3 (u/make-group {:name "group4" :members ["user1" "user5"]})

0 commit comments

Comments
 (0)