Skip to content

Scope the log assertions of the release tests to their session, guard the messages of runOr, surface fatal errors of a disposal, fixes #239 - #260

Merged
morisil merged 3 commits into
mainfrom
issue-239-release-tests
Nov 12, 2026
Merged

morisil merged 3 commits into
mainfrom
issue-239-release-tests

Conversation

@morisil

@morisil morisil commented Nov 11, 2026

Copy link
Copy Markdown
Member

Fixes #239

Developed in parallel to #235 (the turn of execute, branch issue-235-harden-turn), both touching ScriptSession.kt and ScriptSessionTest.kt in different places — whichever merges second may need a small rebase.

Summary

  • Log assertions scoped to their session: the two release tests keep only the WARN events starting with script-session-<id>:.
  • runOr: the message is guarded like kotlin-logging's toStringSafe (a fatal error rethrown, with the block's failure suppressed), its parameter renamed describe (no longer shadowing the builder's message), the level defaults to DEBUG, and readOr is gone.
  • Fatal errors of a disposal surface: Disposer.dispose never throws a disposable's failure itself — the compiler's logger throws an AssertionError caused by it — so a fatal error never reached isFatal. The new disposeTree unwraps it (the first failure only — pinned by DisposeTreeTest); createRepl (both after a failed declaration of the properties and in its catch, via mostSevere) and close() use it, the latter passing it to the session thread's uncaught exception handler.
  • Test leaks: failingSession closed in the finally; the temp directories of SnippetDependencyResolverTest created inside the try.
  • Docs and API: the KDoc of MavenVersionLookup.closed no longer suggests thread safety; the newReplDisposable seam is the last parameter, so a trailing lambda meant for executor no longer compiles there.
  • CLAUDE.md: dispose through disposeTree, re-check the compiler logger's wrapping after a Kotlin upgrade.

Review rounds

  1. No blocking findings; build green; the Disposer / DefaultLogger wrapping confirmed in the bytecode. A short round 2 anyway: the KDoc and CLAUDE.md overstated the coverage (first failure only), the CLAUDE.md entry was misplaced, the block's failure suppressed under a fatal error of the message.
  2. No blocking findings; ./gradlew build green (with checkKotlinAbi); releaseAll / mostSevere checked for a fatal error winning and no self-suppression.

Follow-up

🤖 Generated with Claude Code

https://claude.ai/code/session_019VACgNo6bfV3d3xcHLG4QA

@claude

claude Bot commented Nov 11, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

xxxxxxxxxxxxx and others added 3 commits November 12, 2026 19:53
… the messages of runOr, and throw a fatal error of the disposal of the compiler, fixes #239

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VACgNo6bfV3d3xcHLG4QA
…he block under a fatal error of the message of runOr, fixes #239

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VACgNo6bfV3d3xcHLG4QA


The tests merged with #235 passed the executor as a trailing lambda,
which binds to newReplDisposable, the last parameter since #239.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VACgNo6bfV3d3xcHLG4QA
@morisil
morisil force-pushed the issue-239-release-tests branch from c60e254 to 1d43b96 Compare November 12, 2026 19:58
@morisil

morisil commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main after #254, #258, #264, #256, #262 and #266 were merged. ./gradlew build passes.

Conflicts resolved:

  • SnippetDeclarations.kt, InlinedFrames.kt: this PR only renames logger.readOr to logger.runOr. I took main's rewritten code and applied the rename to it, including the new readOr calls in ScriptErrorReporter.kt. In InlinedFrames.kt, main (Tighten the line attribution of split inlined ranges, and the seams of the inlined frame analysis, fixes #241 #254) had already replaced that call with a try/catch, which is kept.
  • SnippetDependencyResolverTest.kt: kept main's new imports and dropped kotlin.io.path.writeText, now unused, as this PR did.
  • CLAUDE.md: kept both new known-gotcha entries.

New commit 1d43b96: three tests added by #266 passed the session's executor as a trailing lambda. Since this PR moved newReplDisposable to the end of the constructor, such a lambda binds to it and fails to compile. That's the guard this PR documents, so those tests now pass executor = by name, like the other tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_019VACgNo6bfV3d3xcHLG4QA

@claude

claude Bot commented Nov 12, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@morisil
morisil merged commit a141964 into main Nov 12, 2026
2 checks passed
@morisil
morisil deleted the issue-239-release-tests branch November 12, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scope the log assertions of the release tests to their session, and guard the messages of runOr

2 participants