test: make Commands tests random-order safe#10169
Open
memleakd wants to merge 8 commits intocodeigniter4:developfrom
Open
test: make Commands tests random-order safe#10169memleakd wants to merge 8 commits intocodeigniter4:developfrom
memleakd wants to merge 8 commits intocodeigniter4:developfrom
Conversation
96ce295 to
0fd35c5
Compare
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
0fd35c5 to
33e12fc
Compare
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
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.
Description
Related to #9968.
This one took a few rounds: every time the
Commandssuite looked settled, another bit of shared test state quietly raised its hand. The result is a more random-order-safeCommandscomponent, plus a couple of small fixes in shared code that the random runs exposed along the way.This enables
Commandsin the random test config and updates the affected tests so they own their setup/cleanup instead of depending on earlier tests running first.Main changes:
Unsuffixablesupport command provide its own template dataThis PR also touches a few areas outside
tests/system/Commandsbecause the failures were not purely local to one test class:system/Commands/Database/ShowTableInfo.phpnow keepsdb:table --showdisplay IDs sequential even when table arrays have sparse keyssystem/HotReloader/DirectoryHasher.phpnow hashes files in a stable order, which avoids filesystem traversal order differencessystem/Cache/FactoriesCache/FileVarExportHandler.phpnow guards cache writes against concurrent cleanup/recreation racestests/system/HotReloader/DirectoryHasherTest.phpnow uses isolated writable fixtures instead of shared app/system directoriessystem/Log/Handlers/FileHandler.phpnow treats the final chmod after creating a log file as best-effort, so concurrent log cleanup cannot turn logging into a test/app errorVerified locally:
Commandsruns, including failed CI seedsHotReloader,Cookierandom-order runscomposer phpstan:checkvendor/bin/rector process --dry-runcomposer csChecklist: