Skip to content

fix(core): keep allure serve alive when historyPath is configured - #861

Open
svasenkov wants to merge 1 commit into
allure-framework:mainfrom
svasenkov:fix/serve-historypath
Open

fix(core): keep allure serve alive when historyPath is configured#861
svasenkov wants to merge 1 commit into
allure-framework:mainfrom
svasenkov:fix/serve-historypath

Conversation

@svasenkov

Copy link
Copy Markdown
Contributor

Summary

  • Fixes allure serve silently exiting after report generation when historyPath is set in allurerc.mjs (Fixes [CLI] allure serve silently exits without starting the server when historyPath is set #827).
  • Root cause: AllureLocalHistory.appendHistory() piped into a FileHandle write stream with autoClose: false and closed the handle before the stream was destroyed. On Node.js 20+ this leaves a pending promise and can terminate the process before serve starts.
  • Finish and destroy the write stream before closing the file handle.

Test plan

  • packages/core history tests, including a standalone Node subprocess reproducing the FileHandle stream lifecycle
  • packages/cli integration test: allure serve allure-results with historyPath prints Allure is running on http://localhost:… and keeps running
  • Manual repro against published allure@3.14.3 flow (history written, process used to exit with code 0 before server URL)

Made with Cursor

AllureLocalHistory.appendHistory left FileHandle write streams ref'd after
pipeline completed. Closing the handle then made Node exit before report.done()
and serve resolved, which matched the silent allure serve exit in allure-framework#827.

Finish and destroy the write stream before closing the file handle, and add
regression coverage for the stream lifecycle and serve integration.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLI] allure serve silently exits without starting the server when historyPath is set

1 participant