Skip to content

Commit

Permalink
CMR-10323: Int test periodically failing (#2208)
Browse files Browse the repository at this point in the history
* fix test

* wait for caches to finish clearing
  • Loading branch information
jmaeng72 authored Jan 27, 2025
1 parent 1063bb2 commit 8b71d4c
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,75 +24,79 @@

(deftest collection-cmr-only-client-id-test
(testing "ingest operations on CMR-ONLY provider can be submitted by client Echo"
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (dissoc (d/item->concept coll1) :revision-id)]
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "ECHO"))))
(testing "ingest operations on CMR-ONLY provider can be submitted by client other than Echo"
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (dissoc (d/item->concept coll1) :revision-id)]
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "any"))))
(testing "ingest operations on non CMR-ONLY provider can be submitted by client Echo"
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (dissoc (d/item->concept coll1) :revision-id)]
(ingest/update-ingest-provider {:provider-id "PROV1"
:short-name "PROV1"
:cmr-only false
:small false})
(ingest/clear-caches)
(Thread/sleep 3000)
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "ECHO"))))
(testing "ingest operations on non CMR-ONLY provider can be submitted by client other than Echo"
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [coll1 (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (dissoc (d/item->concept coll1) :revision-id)]
(ingest/update-ingest-provider {:provider-id "PROV1"
:short-name "PROV1"
:cmr-only false
:small false})
(ingest/clear-caches)
(Thread/sleep 3000)
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "any")))))

(deftest granule-cmr-only-client-id-test
(testing "ingest operations on CMR-ONLY provider can be submitted by client Echo"
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (d/item->concept (dg/granule-with-umm-spec-collection collection "C1-PROV1"))]
(ingest/ingest-concept concept)
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "ECHO"))))
(testing "ingest operations on CMR-ONLY provider can be submitted by client other than Echo"
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (d/item->concept (dg/granule-with-umm-spec-collection collection "C1-PROV1"))]
(ingest/ingest-concept concept)
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "any"))))
(testing "ingest operations on non CMR-ONLY provider can be submitted by client Echo"
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (d/item->concept (dg/granule-with-umm-spec-collection collection "C1-PROV1"))]
(ingest/ingest-concept concept)
(ingest/update-ingest-provider {:provider-id "PROV1"
:short-name "PROV1"
:cmr-only false
:small false})
(ingest/clear-caches)
(Thread/sleep 3000)
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "ECHO"))))
(testing "ingest operations on non CMR-ONLY provider can be submitted by client other than Echo"
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
concept (d/item->concept (dg/granule-with-umm-spec-collection collection "C1-PROV1"))]
(ingest/ingest-concept concept)
(ingest/update-ingest-provider {:provider-id "PROV1"
:short-name "PROV1"
:cmr-only false
:small false})
(ingest/clear-caches)
(Thread/sleep 3000)
(doseq [func ingest-functions-to-test]
(assert-ingest-success func concept "any")))))

(deftest granule-virtual-product-service-ingest-test
(testing "ingest with Virtual-Product-Service as client-id should succeed for cmr-only provider"
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
granule (dg/granule-with-umm-spec-collection collection "C1-PROV1")
concept (d/item->concept granule)]
(assert-ingest-success #'ingest/validate-concept concept "Virtual-Product-Service")
Expand All @@ -105,14 +109,15 @@
(is (= 0 (:hits (search/find-refs :granule {:granule-ur (:granule-ur granule)
:page-size 50}))))))
(testing "ingest with Virtual-Product-Service as client-id should succeed for non cmr-only provider"
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}) {:validate-keywords false})
(let [collection (d/ingest-umm-spec-collection "PROV1" (data-umm-c/collection {:EntryTitle "ET1"}))
granule (dg/granule-with-umm-spec-collection collection "C1-PROV1")
concept (d/item->concept granule)]
(ingest/update-ingest-provider {:provider-id "PROV1"
:short-name "PROV1"
:cmr-only false
:small false})
(ingest/clear-caches)
(Thread/sleep 3000)
(assert-ingest-success #'ingest/validate-concept concept "Virtual-Product-Service")
(assert-ingest-success #'ingest/ingest-concept concept "Virtual-Product-Service")
(index/wait-until-indexed)
Expand Down

0 comments on commit 8b71d4c

Please sign in to comment.