AVRO-4322: [Java] Guard fast-reader-only assertions in FastReaderBuilderJavaClassTest - #3923
Closed
iemejia wants to merge 1 commit into
Closed
AVRO-4322: [Java] Guard fast-reader-only assertions in FastReaderBuilderJavaClassTest#3923iemejia wants to merge 1 commit into
iemejia wants to merge 1 commit into
Conversation
…derJavaClassTest The java-class / java-key-class -> target class conversion for SpecificData is implemented only on the fast-reader path (FastReaderBuilder). The three specificDataModelUses* tests assert this conversion unconditionally, so they fail in the 'test-without-fast-reader' surefire execution (and the JDK invoker runs) where org.apache.avro.fastread=false, returning Utf8 instead of BigDecimal. This latent failure is currently masked on CI by the Maven build cache skipping the unchanged avro module; it surfaces whenever that module is rebuilt. Skip those assertions via assumeTrue(isFastReaderEnabled()) when the fast reader is disabled.
Contributor
|
I created #3924 to actually fix the test and run it with and without fastreader to make sure the behaviours are consistent! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
FastReaderBuilderJavaClassTestcontains threespecificDataModelUses*tests that assert thejava-class/java-key-class→ target-class conversion (e.g.String→BigDecimal) for theSpecificDatamodel.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 returnsUtf8, so those three tests fail:The
avromodule'stest-without-fast-readersurefire execution (and the JDK-11/17/21 invoker runs) run withorg.apache.avro.fastread=false, so this is a real failure. It is currently masked on CI by the Maven build cache skipping the unchangedavromodule; it surfaces whenever that module is rebuilt.Reproduce:
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. ThegenericDataModelIgnores*tests are unaffected.Verification
Both
BUILD SUCCESS.