Fix Core/Downgrade test failures: add using Dates, fix stdout capture#67
Merged
ChrisRackauckas merged 2 commits intoJun 21, 2026
Merged
Conversation
Two latent bugs surfaced after the SciMLTesting folder-based `run_tests` migration (SciML#63) isolated each test file in its own `@safetestset` module: - `test/import_timing_analysis_tests.jl` and `test/invalidation_analysis_tests.jl` use `now()` / `DateTime(...)` but only did `using OrgMaintenanceScripts` / `using Test`. Under the per-file module isolation those `Dates` names are no longer in scope, so they threw `UndefVarError: now/DateTime not defined`, erroring the Core (julia 1, lts) and Downgrade jobs. Add `using Dates` to both test files. - The import-timing subprocess script redirected stdout into an `IOBuffer`, which `redirect_stdout` does not support (`MethodError: no method matching (::Base.RedirectStdStream)(::IOBuffer)` on both 1.10 and 1.12). Capture into a temp file (an IOStream is supported) and read it back, so the timing analysis actually works instead of always falling into the error branch. Verified locally with `Pkg.test()` GROUP=Core on Julia 1.10 (lts) and 1.12 ("1"): all eight Core test files pass (import_timing 56/56, invalidation 36/36), "Testing OrgMaintenanceScripts tests passed", exit 0. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Downgrade job resolves JSON3 to v1.0.0, where `JSON3.pretty` does not exist (`UndefVarError: pretty not defined`). `write_import_timing_report` calls `JSON3.pretty`, so both its testset and `analyze_repo_import_timing` (which calls it) errored on Downgrade while passing on Core (newer JSON3). `JSON3.pretty` was introduced in JSON3 v1.1.0 (src/pretty.jl). Raising the compat floor from "1" to "1.1" makes the minimum resolved version one that has the function, fixing Downgrade without capping the upper bound (still allows the current v1.14.x). Verified locally on Julia 1.10 with JSON3 pinned to the floor v1.1.0: import_timing_analysis_tests.jl passes 56/56, exit 0, zero errors. Reproduced the original failure on v1.0.0 (UndefVarError) beforehand. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Problem
mainCI is red on three checks — Core (julia 1), Core (julia lts), and Downgrade.Core (julia 1 / lts) — fixed by first commit
Two latent bugs surfaced when #63 migrated the suite to SciMLTesting's folder-based
run_tests, which isolates each test file in its own@safetestsetmodule:Missing
using Dates.test/import_timing_analysis_tests.jlandtest/invalidation_analysis_tests.jlcallnow()/DateTime(...)but only didusing OrgMaintenanceScripts/using Test. Under per-file module isolation thoseDatesnames are no longer in scope, so they threwUndefVarError: now/DateTime not defined.redirect_stdout(::IOBuffer)is unsupported. The import-timing subprocess script redirected stdout into anIOBuffer(MethodErroron 1.10 and 1.12). Now captures into a temp file (anIOStreamis a supportedredirect_stdouttarget) and reads it back.Downgrade — fixed by second commit
With the Core fix in place, Downgrade still failed: it resolves JSON3 to v1.0.0, where
JSON3.prettydoes not exist (UndefVarError: pretty not defined).write_import_timing_reportcallsJSON3.pretty, so both its testset andanalyze_repo_import_timing(which calls it) errored on Downgrade while passing on Core (newer JSON3).JSON3.prettywas introduced in JSON3 v1.1.0 (src/pretty.jl), so the JSON3 compat floor is raised from"1"to"1.1"— the minimum resolved version now has the function, without capping the upper bound (still allows the current v1.14.x).Verification (local)
Pkg.test()GROUP=Core on Julia 1.10 (lts) and 1.12 ("1"), both exit 0, all eight Core files pass (import_timing 56/56, invalidation 36/36).import_timing_analysis_tests.jlpasses 56/56, exit 0, zero errors. Reproduced the originalUndefVarError: prettyon v1.0.0 beforehand.Please ignore until reviewed by @ChrisRackauckas