Skip to content

Commit 47af0ad

Browse files
committed
Use RMain::is_initialized() after all
1 parent 755a0e9 commit 47af0ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/ark/src/connections/r_connection.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ pub unsafe extern "C" fn ps_connection_opened(
277277
let id = Uuid::new_v4().to_string();
278278
let id_r: RObject = id.clone().into();
279279

280-
if harp::test::IS_TESTING {
281-
// If RMain is not initialized, we are probably in testing mode, so we just don't start the connection
282-
// and let the testing code manually do it
280+
if !RMain::is_initialized() {
281+
// If RMain is not initialized, we are probably in unit tests, so we
282+
// just don't start the connection and let the testing code manually do
283+
// it. Note that RMain could be initialized in integration tests.
283284
log::warn!("Connection Pane: RMain is not initialized. Connection will not be started.");
284285
return Ok(id_r.sexp);
285286
}

0 commit comments

Comments
 (0)