STDO-124: Fix NPE and test-isolation failures - #33
Draft
alextwigkit wants to merge 1 commit into
Draft
Conversation
PropertiesLoader.readFolder NPEd on a null listFiles() result; hardened to treat null as no files. FigUtilsTest left the process-wide Fig singleton mutated with no teardown, causing four unrelated MergedPropertiesLoaderTest failures depending on run order. Added an @after reset. Found while verifying a clean build from an empty local Maven repo as part of the STDO-124 source-handoff bet.
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.
Found while verifying a clean build from an empty local Maven repository as part of the STDO-124 Legacy App Studio source-handoff bet: fig is one of six sibling repos this bet is preparing versioned releases of.
What was fixed
PropertiesLoader.readFolderNPEd whenFile.listFiles()returnednull(happens when the directory can't be listed, e.g. a permissions restriction). Hardened to treat anullresult as no files rather than crashing.MergedPropertiesLoaderTestfailures, order-dependent:FigUtilsTestmutates the process-wideFig.getInstance()singleton and never restores it, so a class running afterward in the same JVM inherits a polluted singleton. Added an@Afterteardown that resets it.Both confirmed by isolating the failing tests before and after the fix, not by inference — running each test class alone reproduced/resolved the failure independently of run order.
Verified
mvn clean packagefrom an empty local repository, twice after the fix: exit 0 both times, 54 tests run, 0 failures, 0 errors.Part of the STDO-124 Legacy App Studio perpetual handoff bet; see
PLAN.mdinlucidworks/tbe-pitches(STDO-124-bet) for the full plan.