From 598989f6c64b8f19d3fe7896377e8e686c009af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:46:45 +0000 Subject: [PATCH] testing: with gc() --- tests/testthat/helper-TealAppDriver.R | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/testthat/helper-TealAppDriver.R b/tests/testthat/helper-TealAppDriver.R index 3ef729683..32d8f5e6f 100644 --- a/tests/testthat/helper-TealAppDriver.R +++ b/tests/testthat/helper-TealAppDriver.R @@ -28,8 +28,14 @@ ns_des_input <- function(id, dataname, type) { sprintf("%s-dataset_%s_singleextract-%s", id, dataname, type) } -app_driver_stop <- function(app_driver) { - app_driver_stop(app_driver) - app_driver$get_chromote_session()$parent$close() - app_driver$get_chromote_session()$close() +app_driver_stop <- function(app_driver, envir = parent.frame()) { + withr::defer( + { + app_driver_stop(app_driver) + app_driver$get_chromote_session()$parent$close() + app_driver$get_chromote_session()$close() + gc() + }, + envir = envir + ) }