Skip to content

test: functional test for putBucketIndexes error handling + bump test mongo to 8.0.23#2634

Open
delthas wants to merge 2 commits into
development/8.4from
improvement/ARSN-588/put-bucket-indexes-error-test
Open

test: functional test for putBucketIndexes error handling + bump test mongo to 8.0.23#2634
delthas wants to merge 2 commits into
development/8.4from
improvement/ARSN-588/put-bucket-indexes-error-test

Conversation

@delthas

@delthas delthas commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a functional test for MongoClientInterface.putBucketIndexes error handling — including the case where MongoDB 7.1+ refuses an index build because available disk falls below indexBuildMinAvailableDiskSpaceMB.

Companion to ZENKO-5286 (Backbeat metric for index-creation failures, PR #2750) and ZENKO-5285 (alert for sustained failures).

Commits

  1. test: pin mongodb-memory-server to MongoDB 8.0.23 — version bump in package.json. The library default (7.0.14) doesn't enforce indexBuildMinAvailableDiskSpaceMB; the test needs 7.1+ behavior. 8.0.23 also aligns with what Artesca 4.1+ will run in production.

  2. test: add functional test for putBucketIndexes error handling — new spec covering three cases:

    • Happy path: valid spec → success
    • indexBuildMinAvailableDiskSpaceMB refusal: MongoDB returns OutOfDiskSpace (code 14031) → Arsenal maps to errors.InternalError. The Backbeat putBucketIndexesFailed metric on ZENKO-5286 fires on this.
    • Spec conflict: existing index name + different keys → IndexKeySpecsConflicterrors.InternalError.

Empirical observation

The disk-kill test confirms MongoDB returns:

{"errmsg":"available disk space of N bytes is less than required minimum of M","code":14031,"codeName":"OutOfDiskSpace"}

Arsenal's existing catch handler at MongoClientInterface.putBucketIndexes correctly maps this to errors.InternalError — same path used by all non-NamespaceNotFound MongoDB errors. The Backbeat conductor's metric is cause-agnostic (fires on any putBucketIndexes error), so this gives us the signal regardless of the specific code.

Notes

  • The disk-kill test reads the current indexBuildMinAvailableDiskSpaceMB value via getParameter, sets it to 100 TiB during the test, and restores the original in finally — does not leak state to other tests.
  • Smoke-tested diskUsage.spec.js on 8.0.23 — passes (no regressions on the version bump).
  • The full mongodb functional suite hasn't been run end-to-end on 8.0.23 yet — CI will validate.

Issue: ARSN-588

@bert-e

bert-e commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

bert-e commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@delthas delthas marked this pull request as ready for review June 5, 2026 11:45
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.92%. Comparing base (5944736) to head (c807144).

Additional details and impacted files
@@               Coverage Diff                @@
##           development/8.4    #2634   +/-   ##
================================================
  Coverage            73.92%   73.92%           
================================================
  Files                  229      229           
  Lines                18480    18480           
  Branches              3847     3822   -25     
================================================
  Hits                 13661    13661           
  Misses                4814     4814           
  Partials                 5        5           

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

delthas added 2 commits June 8, 2026 10:59
Align the functional-test MongoDB version with what Artesca 4.1+ runs
in production (the 8.0.x line). The mongodb-memory-server library
defaults to 7.0.14, which does not enforce indexBuildMinAvailableDiskSpaceMB
— the new putBucketIndexes error-handling test (ARSN-588) needs 7.1+
behavior to exercise the disk-space refusal path.

Issue: ARSN-588
Cover three failure modes in MongoClientInterface.putBucketIndexes:

- Happy path: valid spec → success
- indexBuildMinAvailableDiskSpaceMB exceeds available disk:
  MongoDB 8.0+ refuses with OutOfDiskSpace (code 14031),
  Arsenal must map to errors.InternalError. The Backbeat
  conductor's putBucketIndexesFailed metric (ZENKO-5286)
  fires on this InternalError.
- Spec conflict: existing index name + different keys →
  IndexKeySpecsConflict → errors.InternalError.

The disk-kill test reads the current indexBuildMinAvailableDiskSpaceMB
value, sets it to 100 TiB during the test, and restores the original
value in finally.

Issue: ARSN-588
@delthas delthas requested review from a team, SylvainSenechal and francoisferrand June 8, 2026 09:00
@delthas delthas force-pushed the improvement/ARSN-588/put-bucket-indexes-error-test branch from a281059 to c807144 Compare June 8, 2026 09:00
@scality scality deleted a comment from bert-e Jun 8, 2026
@claude

claude Bot commented Jun 8, 2026

Copy link
Copy Markdown

LGTM

Review by Claude Code

@scality scality deleted a comment from claude Bot Jun 8, 2026
Comment thread tests/functional/metadata/mongodb/putBucketIndexes.spec.js
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