Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure with upcoming version of later #40

Closed
wch opened this issue Sep 25, 2019 · 1 comment
Closed

Test failure with upcoming version of later #40

wch opened this issue Sep 25, 2019 · 1 comment

Comments

@wch
Copy link

wch commented Sep 25, 2019

With the version of later that will be released soon, the following test fails:

expect_message({ # Need to force some cycles to happen
Sys.sleep(.1)
later::run_now()
Sys.sleep(.1)
later::run_now()
}, 'Cannot stop server from within a non-blocking event cycle')

This is because run_now() has changed: previously, if any errors/warnings/messages happened in a callback, they would pass all the way through to the caller of run_now(). In the new version of later, run_now uses R_TopLevelExec to invoke the callbacks, and errors/warnings/messages are not passed through R_TopLevelExec. (They will, however, still display at the console.)

You can install the upcoming version of later with:

devtools::install_github('r-lib/later@rc-v1.0.0')

I currently don't know of any way to capture the message generated by a callback invoked by run_now(), so I think your only recourse at this point may be to remove the test. If you can somehow move the expect_message() into the later callback, that would work. But your code may not be structured for that.

@thomasp85
Copy link
Owner

Fixed now - I'll submit next week

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

No branches or pull requests

2 participants