nick-boss-tech opened a new pull request, #5086:
URL: https://github.com/apache/solr/pull/5086

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   https://issues.apache.org/jira/browse/SOLR-12864
   
   ## What happens today
   
   **No test runs echo and mapUniqueKeyOnly together on the JSON update path.**
   
   The ticket reports an empty `text` list in the echoed document when 
`mapUniqueKeyOnly` is set. Reading the code on base, the echoed copy keeps the 
collected values, so this symptom does not reproduce there 
([getDocMap](https://github.com/nick-boss-tech/solr/blob/b9c6c1e71ffa9a7f68d7ac126206cd2f14af4aaa/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java#L295-L326)).
 The existing tests cover echo alone (`testEchoDocs`) and `mapUniqueKeyOnly` 
alone (`testSrcAndUniqueDocs`). The combination has no test.
   
   ## What this change does
   
   **Adds one test method for the SOLR-16811 path. It is coverage, not a bug 
fix.**
   
   - Adds 
[`testEchoDocsWithMapUniqueKeyOnly`](https://github.com/nick-boss-tech/solr/blob/b9c6c1e71ffa9a7f68d7ac126206cd2f14af4aaa/solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java#L401-L436).
 It sends `echo=true`, `mapUniqueKeyOnly=true` and `df=_catch_all` to the 
`/update/json/docs` path, with or without `srcField`. It checks the echoed 
documents.
   - The path it covers was changed by 
[SOLR-16811](https://issues.apache.org/jira/browse/SOLR-16811), which is 
already in base.
   - The test guards one regression. If the echoed copy ever pointed into the 
reused record map, the `df` values would go empty again.
   - The only file that differs from base is `JsonLoaderTest.java`.
   
   ## Proof
   
   **This is a test-only change, so the fail-before check is inconclusive by 
construction.**
   
   - `JsonLoaderTest` 32 of 32, verified 2026-10-08 at head `b9c6c1e71ffa`.
   - The new test, `testEchoDocsWithMapUniqueKeyOnly`, is expected to pass on 
base. That is the intended coverage result, because the SOLR-16811 fix is 
already in base. A fail-before run cannot show a failure here, so this draft 
does not claim one.
   
   ## A choice to check
   
   **Keep a passing test for a path that is already fixed, or drop it.**
   
   The options are to keep this test as coverage, or to drop the PR because 
SOLR-16811 already fixed the path. The test adds one method and is expected to 
pass on base. Was keeping it the right call?
   
   ## Limits
   
   - The test covers one combination only: echo with `mapUniqueKeyOnly` on the 
JSON update path.
   - The `srcField` branch is chosen at random in the test, so a single run 
uses one branch.
   
   Changelog: this branch adds no changelog fragment.
   
   ### AI assistance
   
   AI agents assisted with research, implementation, review, and drafting. Nick 
Shanin directed the work and takes responsibility for this contribution.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to