Skip to content

fix: inject --auto-servernum via executable property to fix xvfb-run on kernel restart#323

Merged
blink1073 merged 1 commit into
Calysto:mainfrom
blink1073:fix-320-again
Apr 8, 2026
Merged

fix: inject --auto-servernum via executable property to fix xvfb-run on kernel restart#323
blink1073 merged 1 commit into
Calysto:mainfrom
blink1073:fix-320-again

Conversation

@blink1073
Copy link
Copy Markdown
Contributor

References

Closes #320

Description

Follow-up to #321. The prior fix injected --auto-servernum only in _validate_executable, but _create_repl used self.executable directly — without the flag. On kernel restart, when an Xvfb server was already running, xvfb-run would exit with status 1 and the kernel would fail to start.

Changes

  • Convert executable to a property that normalises the xvfb-run command by injecting --auto-servernum when needed
  • Store the raw value in _executable; all callers (_validate_executable, _create_repl, _get_temp_dir) automatically get the corrected string
  • Simplify _validate_executable now that injection is handled by the property
  • Move xvfb --auto-servernum tests from TestValidateExecutable to a new TestExecutableProperty class

Backwards-incompatible changes

None

Testing

Existing test suite passes (uv run pytest tests/test_engine.py). The xvfb injection is now verified through the property tests rather than via _validate_executable.

AI usage

  • Some or all of the content of this PR was generated by AI.
  • The human author has carefully reviewed this PR and run this code.
  • AI tools and models used: Claude (claude-sonnet-4-6)

…on restart

The prior fix (Calysto#321) only injected --auto-servernum in _validate_executable,
leaving _create_repl to use the raw executable without it. On kernel restart,
xvfb-run would conflict with the already-running Xvfb and exit with status 1.

Centralise the normalisation in an `executable` property so all callers
automatically get the corrected command string. Simplify _validate_executable
accordingly and move the xvfb tests to TestExecutableProperty.

Closes Calysto#320
@blink1073 blink1073 added the bug label Apr 8, 2026
@blink1073 blink1073 enabled auto-merge (squash) April 8, 2026 18:43
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.90%. Comparing base (5790e9d) to head (eee2101).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #323      +/-   ##
==========================================
+ Coverage   92.85%   92.90%   +0.04%     
==========================================
  Files           6        6              
  Lines         434      437       +3     
==========================================
+ Hits          403      406       +3     
  Misses         31       31              
Flag Coverage Δ
linux 92.67% <100.00%> (+0.05%) ⬆️
windows 92.90% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
octave_kernel/kernel.py 93.91% <100.00%> (+0.04%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blink1073 blink1073 merged commit 48eae77 into Calysto:main Apr 8, 2026
27 checks passed
@blink1073 blink1073 deleted the fix-320-again branch April 8, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restarting the kernel does not work with the Octave executable

1 participant