[ 
https://issues.apache.org/jira/browse/TIKA-4526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18031052#comment-18031052
 ] 

ASF GitHub Bot commented on TIKA-4526:
--------------------------------------

LucaDai opened a new pull request, #2368:
URL: https://github.com/apache/tika/pull/2368

   ## Description
   
   **Issue: [[TIKA-4526](https://issues.apache.org/jira/browse/TIKA-4526)]
   
    **Type of change**
   
   * [ ] New feature
   * [ ] Bug fix for existing feature
   * [x] Code quality improvement
   * [x] Addition or Improvement of tests
   * [ ] Addition/Improvement of documentation
   
   ## Summary
   
   The failure was caused by ambiguous method mappings in TranslateResource, 
where both the `translate` and `autoTranslate` methods were annotated with both 
@PUT and @POST at the same time.
   
   A similar issue was fixed in the previous merged PR, which included a 
detailed **explanation** and how to **reproduce**:
   https://github.com/apache/tika/pull/2360
   
   ## Related Tests
   
   ```
   org.apache.tika.server.core.TranslateResourceTest.testTranslateFull
   org.apache.tika.server.core.TranslateResourceTest.testTranslateAutoLang
   ```
   ## Verification
   
   * ✅ `mvn test -pl tika-server/tika-server-core` passes.
   * ✅ Multiple NonDex runs (`-DnondexRuns=100`) pass with no flakes.
   * ✅ Checkstyle passes.
   * ✅ No behavior change to REST paths or media types; only internal method 
split and safer input handling.
   
   Please let me know if anything needs to change regarding the code style.




> Nondeterministic failures in TranslateResourceTest
> --------------------------------------------------
>
>                 Key: TIKA-4526
>                 URL: https://issues.apache.org/jira/browse/TIKA-4526
>             Project: Tika
>          Issue Type: Test
>          Components: tika-server
>            Reporter: Tiancheng Dai
>            Priority: Minor
>              Labels: NonDex, test-stability
>
> *Summary:*
> TranslateResourceTest shows nondeterministic failures when run with 
> NonDex(shuffling nondeterministic method to find flakiness).
> ----
> *Observation / How to Reproduce:*
> Running the following command may intermittently fail with errors:
>  
> {{mvn edu.illinois:nondex-maven-plugin:2.2.1:nondex \
>   -pl tika-server/tika-server-core \
>   -Dtest=org.apache.tika.server.core.TranslateResourceTest \
>   -DnondexRuns=5}}
> *Observed behavior:*
> {{[INFO] -------------------------------------------------------}}
> {{[INFO]  T E S T S}}
> {{[INFO] -------------------------------------------------------}}
> {{[INFO] Running org.apache.tika.server.core.TranslateResourceTest}}
> {{[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 
> 0.670 s <<< FAILURE! -- in org.apache.tika.server.core.TranslateResourceTest}}
> {{[ERROR] org.apache.tika.server.core.TranslateResourceTest.testTranslateFull 
> -- Time elapsed: 0.644 s <<< FAILURE!}}
> {{org.opentest4j.AssertionFailedError: expected: <This won't translate> but 
> was: <>}}
> {{        at 
> org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:158)}}
> {{        at 
> org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:139)}}
> {{        at 
> org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:201)}}
> {{        at 
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:184)}}
> {{        at 
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:179)}}
> {{        at 
> org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1188)}}
> {{{}        at 
> org.apache.tika.server.core.TranslateResourceTest.testTranslateFull(TranslateResourceTest.java:73){}}}{{{}[ERROR]
>  org.apache.tika.server.core.TranslateResourceTest.testTranslateAutoLang -- 
> Time elapsed: 0.017 s <<< FAILURE!{}}}
> {{org.opentest4j.AssertionFailedError: expected: <This won't translate> but 
> was: <>}}
> {{        at 
> org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:158)}}
> {{        at 
> org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:139)}}
> {{        at 
> org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:201)}}
> {{        at 
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:184)}}
> {{        at 
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:179)}}
> {{        at 
> org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1188)}}
> {{{}        at 
> org.apache.tika.server.core.TranslateResourceTest.testTranslateAutoLang(TranslateResourceTest.java:86){}}}{{{}[INFO]
>  {}}}
> {{[INFO] Results:}}
> {{[INFO] }}
> {{[ERROR] Failures: }}
> {{[ERROR]   TranslateResourceTest.testTranslateAutoLang:86 expected: <This 
> won't translate> but was: <>}}
> {{[ERROR]   TranslateResourceTest.testTranslateFull:73 expected: <This won't 
> translate> but was: <>}}
> {{[INFO] }}
> {{{}[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0{}}}{{{}{}}}
> *Expected behavior:*
> *The test should deterministically pass under all NonDex seeds.*



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to