Skip to content

CMR-11364: fix shapefile test cleanup timing - #2476

Open
zimzoom wants to merge 1 commit into
masterfrom
CMR-11364-e
Open

CMR-11364: fix shapefile test cleanup timing#2476
zimzoom wants to merge 1 commit into
masterfrom
CMR-11364-e

Conversation

@zimzoom

@zimzoom zimzoom commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Overview

What is the objective?

To fix intermittent system integration test failures while validating force-Cartesian shapefile search behavior. Specifically, the test collection-shapefile-force-cartesian-validation-test intermittently received HTTP 400 when force-cartesian=true should have allowed the uploaded GeoJSON.

What are the changes?

The test in question uses a Scotland file that is approximately 292 KB and contains approximately 3,000 coordinate points. Another test in the same system integration group, granule-shapefile-failure-cases, temporarily changes search-app’s process-wide shapefile limits to 50 KB maximum upload size, 50 maximum points, and 2 maximum features. The Scotland fixture exceeds both temporary size and point limits. This creates a shared-state hazard: if the temporary values leak from the granule failure test—or are observed by another test while active—the force-Cartesian request returns 400 before its intended geometry behavior can be tested.

Previously, those global settings were restored only at the end of the test body. An exception or unexpected exit before reaching the cleanup statements could leave the search application using the test-specific limits. The change wraps the temporary overrides in try/finally, ensuring that all three settings are restored even when the test exits abnormally.

Also, enhanced debugging was added.

What areas of the application does this impact?

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

Additional Checklist

  • I have removed unnecessary/dead code and imports in files I have changed
  • I have cleaned up integration tests by doing one or more of the following:
    • migrated any are2 tests to are3 in files I have changed
    • de-duped, consolidated, removed dead int tests
    • transformed applicable int tests into unit tests
    • reduced number of system state resets by updating fixtures. Ex) (use-fixtures :each (ingest/reset-fixture {})) to be :once instead of :each

@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.93%. Comparing base (1db234b) to head (f9a5032).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2476      +/-   ##
==========================================
- Coverage   57.93%   57.93%   -0.01%     
==========================================
  Files        1073     1073              
  Lines       74658    74658              
  Branches     2177     2172       -5     
==========================================
- Hits        43251    43250       -1     
  Misses      29379    29379              
- Partials     2028     2029       +1     

☔ 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.

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.

3 participants