Skip to content

Tests that show register shutdown function issue (#70) is invalid - #108

Merged
swissspidy merged 5 commits into
wp-cli:mainfrom
justinmaurerdotdev:cron-command-issue-70
Mar 31, 2025
Merged

swissspidy merged 5 commits into
wp-cli:mainfrom
justinmaurerdotdev:cron-command-issue-70

Conversation

@justinmaurerdotdev

@justinmaurerdotdev justinmaurerdotdev commented Sep 17, 2024 •

Copy link
Copy Markdown
Contributor

This addresses #70. This one is sort of complicated to reproduce accurately, but these tests demonstrate that a registered shutdown function is capable of writing to a file, so the reported issue is invalid, and can probably be safely closed as a "will not fix". Brian and I decided that we preferred the error_log() demonstration over file_put_contents() for Behat, but we tested both ways and the result was the same.

Submitted during Contributor Day.

Comment thread features/cron-event.feature Outdated

register_shutdown_function(function() {
error_log('LOG A SHUTDOWN FROM ERROR');
// file_put_contents( dirname( __FILE__ ) . '/log.log', print_r( 'Shutdown called correctly', true ) . "\r\n\r\n", FILE_APPEND );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed.

Comment thread features/cron-event.feature Resolved
@swissspidy swissspidy linked an issue Mar 31, 2025 that may be closed by this pull request
2 tasks done
@swissspidy swissspidy added the scope:testing Related to testing label Mar 31, 2025
@swissspidy
swissspidy merged commit 984b30b into wp-cli:main Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When running cron event produces a fatal error, the shutdown function doesn't run

3 participants