iemejia opened a new pull request, #3923:
URL: https://github.com/apache/avro/pull/3923

   ## Problem
   
   `FastReaderBuilderJavaClassTest` contains three `specificDataModelUses*` 
tests that assert the `java-class` / `java-key-class` → target-class conversion 
(e.g. `String` → `BigDecimal`) for the `SpecificData` model.
   
   That conversion is implemented **only on the fast-reader path** 
(`FastReaderBuilder`). When the fast reader is disabled 
(`-Dorg.apache.avro.fastread=false`), the classic path returns `Utf8`, so those 
three tests fail:
   
   ```
   SpecificData should use the class in 'java-class' ==>
   Unexpected type, expected: <java.math.BigDecimal> but was: 
<org.apache.avro.util.Utf8>
   ```
   
   The `avro` module's `test-without-fast-reader` surefire execution (and the 
JDK-11/17/21 invoker runs) run with `org.apache.avro.fastread=false`, so this 
is a real failure. It is currently **masked on CI by the Maven build cache** 
skipping the unchanged `avro` module; it surfaces whenever that module is 
rebuilt.
   
   Reproduce:
   
   ```
   cd lang/java
   mvn -pl avro surefire:test -Dtest=FastReaderBuilderJavaClassTest 
-Dorg.apache.avro.fastread=false
   # -> Tests run: 6, Failures: 3
   ```
   
   ## Fix
   
   Guard the three fast-reader-only assertions with 
`assumeTrue(SpecificData.get().isFastReaderEnabled(), ...)`, so they are 
skipped (not failed) when the fast reader is disabled. The 
`genericDataModelIgnores*` tests are unaffected.
   
   ## Verification
   
   ```
   # fast reader ON  -> Tests run: 6, Failures: 0, Skipped: 0
   # fast reader OFF -> Tests run: 6, Failures: 0, Skipped: 3
   ```
   
   Both `BUILD SUCCESS`.


-- 
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]

Reply via email to