Skip to content

Commit 3350121

Browse files
committed
Revert added test.
Failure case is crashing the whole test suite, also may not be reliable
1 parent 25692b4 commit 3350121

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

  • Modules/_testcapi

‎Modules/_testcapi/gc.c‎

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -271,42 +271,6 @@ test_gc_visit_objects_exit_early(PyObject *Py_UNUSED(self),
271271
Py_RETURN_NONE;
272272
}
273273

274-
#ifndef Py_GIL_DISABLED
275-
static int
276-
gc_visit_callback_drop_current(PyObject *obj, void *arg)
277-
{
278-
struct gc_visit_state_basic *state = (struct gc_visit_state_basic *)arg;
279-
if (obj == state->target) {
280-
state->found = 1;
281-
Py_CLEAR(state->target);
282-
}
283-
return 1;
284-
}
285-
286-
static PyObject *
287-
test_gc_visit_objects_drop_current(PyObject *Py_UNUSED(self),
288-
PyObject *Py_UNUSED(ignored))
289-
{
290-
struct gc_visit_state_basic state;
291-
292-
state.target = PySet_New(NULL);
293-
if (state.target == NULL) {
294-
return NULL;
295-
}
296-
state.found = 0;
297-
298-
PyUnstable_GC_VisitObjects(gc_visit_callback_drop_current, &state);
299-
if (!state.found) {
300-
Py_DECREF(state.target);
301-
PyErr_SetString(
302-
PyExc_AssertionError,
303-
"test_gc_visit_objects_drop_current: Didn't find live set");
304-
return NULL;
305-
}
306-
Py_RETURN_NONE;
307-
}
308-
#endif
309-
310274
typedef struct {
311275
PyObject_HEAD
312276
} ObjExtraData;
@@ -405,9 +369,6 @@ static PyMethodDef test_methods[] = {
405369
{"test_gc_visit_objects_basic", test_gc_visit_objects_basic, METH_NOARGS, NULL},
406370
{"test_gc_visit_objects_frozen", test_gc_visit_objects_frozen, METH_NOARGS, NULL},
407371
{"test_gc_visit_objects_exit_early", test_gc_visit_objects_exit_early, METH_NOARGS, NULL},
408-
#ifndef Py_GIL_DISABLED
409-
{"test_gc_visit_objects_drop_current", test_gc_visit_objects_drop_current, METH_NOARGS, NULL},
410-
#endif
411372
{"without_gc", without_gc, METH_O, NULL},
412373
{"with_tp_del", with_tp_del, METH_VARARGS, NULL},
413374
{NULL}

0 commit comments

Comments
 (0)