thomasp85/fiery

Test failure with upcoming version of later

Closed this issue · 1 comments

wch commented

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.

Fixed now - I'll submit next week