Skip to content

Commit 152f53e

Browse files
committed
Test: Always run the TypedPython leak test now that #98 is fixed
1 parent e1dc7f5 commit 152f53e

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

‎ksp-fixtures/app/src/commonMain/kotlin/fixture/app/TypedPythonBridge.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ fun tpCheck(value: Double, limit: Double): Double {
5252
* wrapper unreachable -- so the token's `sys.getrefcount` is only meaningful after a JVM collection
5353
* and the cleaner have run (`TypedPythonKotlinCallTest.settledCounts`).
5454
*
55-
* Deliberately **not** closed here: closing a `PyObject` argument inside an upcall releases its
56-
* reference twice and crashed the test JVM (`Py_XDECREF` on the cleaner thread) -- binder issue #98.
55+
* Not closed here, so the test also covers the cleaner path. Closing it would be equally correct:
56+
* `close()` gives back the wrapper's one reference and the cleaner then has nothing left to release
57+
* (`closeArgument`, `PyObjectArgumentReleaseTest`). The JVM crash once blamed on that (issue #98) came
58+
* from a test wrapping fake addresses as owned objects, not from the binder.
5759
*/
5860
fun tpTouch(token: PyObject?): Long {
5961
TpBridgeLedger.touches += 1

‎ksp-fixtures/app/src/desktopTest/kotlin/fixture/app/TypedPythonKotlinCallTest.kt‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ class TypedPythonKotlinCallTest {
229229
*/
230230
@Test
231231
fun tenThousandCompiledCallsLeakNoReferenceAndNoKotlinHandle() {
232-
// Blocked by python-multiplatform#98: when the cleaner releases the wrappers that 10,000
233-
// upcalls leave behind, the binder releases one reference twice and the JVM dies (SIGSEGV in
234-
// Py_XDECREF on Cleaner-0) -- on the interpreted control as much as on the compiled loop.
235-
// Re-enable with -Dtypedpython.leakTest=true once #98 is fixed.
236-
assumeTrue(
237-
"blocked by python-multiplatform#98 (binder double release on the cleaner path)",
238-
System.getProperty("typedpython.leakTest") == "true",
239-
)
240232
Python3.exec(
241233
"""
242234
import gc, sys, sysconfig

0 commit comments

Comments
 (0)