You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/dgkf/covr-r6-active-binding-test
cd covr-r6-active-binding-test
R -e 'options(covr.record_tests = TRUE)' -e 'covr::package_coverage()'
Details
From what I can tell, there are a few key features of this package that culminate in this bug:
An R6 active binding is included in the test call stack
For reasons that are still unclear to me, the sys.calls() captured in update_current_test(), when capturing an active binding, includes the R function, not just the call. Critically, this function brings its calling environment.
When the R6 object environment includes a parquet dataset (I'm assuming due to the way arrow works with the in-memory representation of the data), this environment segfaults when serialized to disk.
Proposed solution
Will first try to drill into why this is grabbing a function. There might be a more holistic way to avoiding this altogether.
If there's no better way to avoid functions in the call stack, then before recording the call stack, if a frame contains a function, set its environment to emptyenv() so it can be serialized.
The text was updated successfully, but these errors were encountered:
I can open a PR whenever you'd like, but I'd prefer to test it in some more real-world applications first to make sure there aren't any severe performance implications and that no necessary data gets thrown out.
Note
This is in code I introduced and only affects very specific scenarios when
options(covr.record_tests)
is enabled.I plan to fix this
Example at dgkf/covr-r6-active-binding-test
Details
From what I can tell, there are a few key features of this package that culminate in this bug:
sys.calls()
captured inupdate_current_test()
, when capturing an active binding, includes the R function, not just the call. Critically, this function brings its calling environment.Proposed solution
emptyenv()
so it can be serialized.The text was updated successfully, but these errors were encountered: