Skip to content

Commit 1f6eff1

Browse files
Clarify and enhance confusing precompile test (#59170)
1 parent 9a16119 commit 1f6eff1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/precompile.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,10 @@ precompile_test_harness(false) do dir
691691
error("the \"break me\" test failed")
692692
catch exc
693693
isa(exc, ErrorException) || rethrow()
694-
occursin("ERROR: LoadError: break me", exc.msg) && rethrow()
694+
# The LoadError shouldn't be surfaced but is printed to stderr, hence the `@test_warn` capture tests
695+
occursin("LoadError: break me", exc.msg) && rethrow()
696+
# The actual error that is thrown
697+
occursin("Failed to precompile FooBar2", exc.msg) || rethrow()
695698
end
696699

697700
# Test that trying to eval into closed modules during precompilation is an error

0 commit comments

Comments
 (0)