Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMR-10323: Int test periodically failing #2208

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

@eereiter eereiter Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well - an increase in testing time - here and for other tests. But this still could break if the tests are running slow? Can clear-caches be made synchronous or is there a way to tell when the cache is clear? Or are we waiting on something else? Why do we have to wait?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the errors were coming from the kms cache not reseting and so we got a lot of validation errors. I'm sure we could create another func or update this one to make clear-cache synchronous but it is attached to a func that is clearing all the dev-system caches at once.

And yes the test could potentially fail if 3 seconds is not long enough to wait for all the caches to refresh

(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
Loading