Skip to content

MLE-33561: Purge unrecoverable dead test code - #1986

Draft
vishwach wants to merge 1 commit into
developfrom
MLE-33561
Draft

vishwach wants to merge 1 commit into
developfrom
MLE-33561

Conversation

@vishwach

@vishwach vishwach commented Nov 4, 2026 •

Copy link
Copy Markdown

This PR cleans up historical dead test debt across the test suite by permanently removing 7 dead code sites (unexecuted Early Access prototypes, unfinished plan builders, commented-out test stubs, orphaned batcher helpers, and obsolete comment banners) along with their unused imports and fixtures.

None of these sites were active tests in CI. Their removal eliminates codebase clutter and confusion with zero loss in test coverage.

Detailed Breakdown of Purged Dead Code Sites

# File & Location Nature of Code Why Safe to Delete & Where Covered
1 StringQueryHostBatcherTest.java:741
testQueryBatcherQueryFailures
Commented-out // @Test Fully covered elsewhere. Host failure and retry callbacks are actively tested in QueryBatcherTest and HostAvailabilityListenerTest.
2 WriteHostBatcherTest.java:2170
testDisableDBDuringInsert
Commented-out // @Test Fully covered elsewhere. Mid-stream write errors and socket resets are covered in WriteBatcherFailureTest and active WriteHostBatcherTest listener suites.
3 WriteHostBatcherTest.java
(Additional site / Orphaned helper)
Orphaned helper method / fixture Orphaned code removal. Had zero active callers once testDisableDBDuringInsert was purged; removed to keep -Werror clean.
4 TestOpticOnLiterals.java:1093
testBuiltInFns
Incomplete EA-3 draft (no @Test, zero assertions) Fully covered elsewhere. Optic built-ins are exhaustively tested in OpticOnLiteralsTest, OpticPlanTest, and PlanGeneratedTest.
5 TestAppServerConstraints.java:155
testWithWordConstraintAndGoogleGrammar
Incomplete EA-3 draft with no assertions Fully covered elsewhere. Query grammar and word constraints are tested in SearchQueryDefinitionTest and TestQueryOptionBuilder.
6 TestPOJOReadWriteWithTransactions.java:294
test4POJOSearchWithCollectionsandTransaction
Unannotated method (missing @Test, never run) Fully covered elsewhere. POJO multi-statement transaction CRUD is covered by adjacent tests in the same class and PojoRepositoryTest.
7 TestQueryOptionBuilder.java:1768
(Comment block only)
Leftover comment headers (Begin/End) referencing tests deleted before 4.0.2 Pure comment cleanup. No code existed. Query sorting options are thoroughly tested across TestQueryOptionBuilder. Active test logic was preserved to avoid conflict with MLE-32873.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 08:50
@vishwach
vishwach marked this pull request as draft November 4, 2026 08:50

Copilot AI left a comment

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.

🟢 Approval recommended

No active review issues are blocking approval.

No open issues 🎉

What changed in this PR

Removes dead code and unused resources from the functional-test module without changing production code or JUnit-discovered tests.

Changes:

  • Deletes unfinished methods without @Test and obsolete commented-out test code.
  • Removes the associated database-disabling helper and unused query-options fixture.
  • Deletes a stale comment about issue #347; query-option behavior is unchanged.

Paths below are relative to marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/.

File Description
functionaltest/​queryoptions/​collectionConstraintWithWordConstraintAndGoogleGrammarOpt.xml Deletes the unused query-options fixture.
fastfunctest/​TestQueryOptionBuilder.java Removes only the stale issue #347 comment block.
fastfunctest/​TestPOJOReadWriteWithTransactions.java Removes an undiscovered collection-search transaction test.
fastfunctest/​TestOpticOnLiterals.java Removes an unfinished built-in functions test.
fastfunctest/​TestAppServerConstraints.java Removes the undiscovered Google-grammar constraint test.
datamovement/​functionaltests/​WriteHostBatcherTest.java Removes an unfinished database-disable test and its helper class.
datamovement/​functionaltests/​StringQueryHostBatcherTest.java Removes an unfinished query-failure test and commented-out batcher contention test.

Review effort: Balanced

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