Skip to content

CMR-11368: Databine test improvements - #2472

Open
jceaser wants to merge 11 commits into
masterfrom
cmr-11368-databine
Open

CMR-11368: Databine test improvements#2472
jceaser wants to merge 11 commits into
masterfrom
cmr-11368-databine

Conversation

@jceaser

@jceaser jceaser commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Overview

Background

This ticket started out as a Snyk ticket, however Jackson had a lot of issues and another ticket ended up applying the needed library change. In the course of doing the work to support 2.21.5 severely intermittent test issues prevented this ticket from being properly tested in bamboo and it was decided to fix those issues.

What are the changes?

  • Moving two tests from access control app to system int test
  • adding serial to tests so that the tests in question would not run while other tests run
  • adding try/final blocks to ensure that when the service being tested is set to read only mode, it is always set back so that there are no cascading errors from these tests.

What areas of the application does this impact?

  • access-control-app
  • system-int-test

Required Checklist

  • New and existing unit and int tests pass locally and remotely
  • clj-kondo has been run locally and all errors in changed files are corrected
  • I have commented my code, particularly in hard-to-understand areas
  • [-] I have made changes to the documentation (if necessary)
  • [-] My changes generate no new warnings

@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.19%. Comparing base (0b364bd) to head (211e67f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2472      +/-   ##
==========================================
- Coverage   29.20%   29.19%   -0.02%     
==========================================
  Files        1014     1014              
  Lines       71257    71257              
  Branches     1265     1265              
==========================================
- Hits        20811    20800      -11     
- Misses      49244    49255      +11     
  Partials     1202     1202              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jceaser
jceaser force-pushed the cmr-11368-databine branch from e012631 to 7890190 Compare August 31, 2026 19:57
@jceaser
jceaser requested a review from ibsenc August 31, 2026 22:01
@jceaser
jceaser marked this pull request as ready for review September 1, 2026 14:09
Comment thread access-control-app/src/cmr/access_control/services/acl_search_service.clj Outdated
["GUEST" "AG10000-PROV"] (concat guest-acls AG10000-acls)
["AG12345-PROV" "AG10000-PROV"] (concat AG12345-acls AG10000-acls)
["guest" "registered" "AG12345-PROV" "AG10000-PROV"] all-acls-no-admin))
(u/without-publishing-messages

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this was a suggestion to prevent expected exceptions from showing up in the logs

(finally
;; always re-enable writes for access control service
(u/enable-access-control-writes post-options)
(Thread/sleep 500))))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Try/finally was added to ensure that the services was always put back into read/write mode so that other tests could pass. This allows other tests to continue to run and not fail incorrectly. A delay was added to ensure the other service has time to take effect.

This is one of the intermittent errors we would get.

(finally
;; Allways re-eneable writes for access control service, even if there was an exception
(u/enable-access-control-writes post-options)
(Thread/sleep 500))))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Try/finally was added to ensure that the services was always put back into read/write mode so that other tests could pass. This allows other tests to continue to run and not fail incorrectly. A delay was added to ensure the other service has time to take effect.

This is one of the intermittent errors we would get.

(has-action-permission? (url/enable-access-control-writes-url) :post admin-read-update-token)
(has-action-permission? (url/enable-email-subscription-processing) :post admin-read-update-token)
;; Give the servers time set
(Thread/sleep 500)))))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Try/finally was added to ensure that the services was always put back into read/write mode so that other tests could pass. This allows other tests to continue to run and not fail incorrectly. A delay was added to ensure the other service has time to take effect.

This is one of the intermittent errors we would get.

@jceaser jceaser changed the title CMR-11368: Databine, initial test CMR-11368: Databine test improvements Sep 2, 2026
@jceaser
jceaser requested a review from eereiter September 2, 2026 19:02
Comment thread metadata-db-app/project.clj Outdated
Comment thread access-control-app/src/cmr/access_control/services/acl_search_service.clj Outdated
@jceaser
jceaser requested a review from jmaeng72 September 3, 2026 17:59
{:revision-date-range "2000-01-01T10:00:00Z,2010-03-10T12:00:00Z"}))
(finally
;; Always guarantee writes are re-enabled after this test suite!
(has-action-permission? (url/enable-ingest-writes-url) :post admin-read-update-token)

@jaortega527 jaortega527 Sep 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if a 401 is returned when enabling one of these features I think it would do so silently as written. That may not be likely, but I think adding a check on the response and having a message that lets us know that one of the features failed to be re-enabled and would make it easier to diagnose if there are test failures due to a features not being enabled in the future.

I don't see this as a blocking issue, but wanted to share the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants