10000 Enable TestPyTupleInvalidAppend test · sdpython/pythonnet@cef6153 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Commit cef6153

Browse files
committed
Enable TestPyTupleInvalidAppend test
`AppDomain unload` was solved by pythonnet#400. Closes pythonnet#397. Possibly also solved pythonnet#245.
1 parent f2519f7 commit cef6153

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
4747
- Fixed wrong version number in `conda.recipe` (#398)
4848
- Fixed fixture location for Python tests and `Embedded_Tests`
4949
- Fixed `PythonException` crash during Shutdown (#400)
50+
- Fixed `AppDomain` unload during GC (#397)(#400)
5051
- Fixed `Py_Main` & `PySys_SetArgvEx` no mem error on `UCS4/PY3` (#399)
5152

5253
### Removed

src/embed_tests/dynamic.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public void AssignPyObject()
6868
if (Environment.GetEnvironmentVariable("TRAVIS") == "true" &&
6969
Environment.GetEnvironmentVariable("TRAVIS_PYTHON_VERSION") == "2.7")
7070
{
71-
// Most recently threw `auto-releasing thread-state, but no thread-state for this thread`
72-
// instead of the error below. Maybe had bad mapping to library?
7371
Assert.Ignore("Fails on Travis/PY27: ImportError: ... undefined symbol: _PyLong_AsInt");
7472
}
7573

@@ -84,9 +82,6 @@ public void AssignPyObject()
8482
/// <summary>
8583
/// Pass the .NET object in Python side.
8684
/// </summary>
87-
/// <remarks>
88-
/// FIXME: Possible source of intermittent Travis PY27: Unable to unload AppDomain.
89-
/// </remarks>
9085
[Test]
9186
public void PassObjectInPython()
9287
{

src/embed_tests/pytuple.cs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ public class PyTupleTest
1010
/// Test IsTupleType without having to Initialize a tuple.
1111
/// PyTuple constructor use IsTupleType. This decouples the tests.
1212
/// </summary>
13-
/// <remarks>
14-
/// Travis PY27 intermittently fails this test. Indicates issue is
15-
/// most likely with PyTuple.IsTupleType
16-
/// </remarks>
1713
[Test]
1814
public void TestStringIsTupleType()
1915
{
10000
@@ -47,15 +43,16 @@ public void TestPyTupleEmpty()
4743
}
4844
}
4945

46+
/// <summary>
47+
/// Test PyTuple.Concat(...) doesn't let invalid appends happen
48+
/// and throws and exception.
49+
/// </summary>
5050
/// <remarks>
51-
/// FIXME: Unable to unload AppDomain, Unload thread timed out.
52-
/// Seen on Travis/AppVeyor on both PY2 and PY3. Causes Embedded_Tests
53-
/// to hang after they are finished for ~40 seconds until nunit3 forces
54-
/// a timeout on unloading tests. Doesn't fail the tests though but
55-
/// greatly slows down CI. nunit2 silently has this issue.
51+
/// Test has second purpose. Currently it generated an Exception
52+
/// that the GC failed to remove often and caused AppDomain unload
53+
/// errors at the end of tests. See GH#397 for more info.
5654
/// </remarks>
5755
[Test]
58-
[Ignore("GH#397: Travis/AppVeyor: Unable to unload AppDomain, Unload thread timed out")]
5956
public void TestPyTupleInvalidAppend()
6057
{
6158
using (Py.GIL())
@@ -106,10 +103,6 @@ public void TestPyTupleValidConvert()
106103
}
107104
}
108105

109-
/// <remarks>
110-
/// FIXME: Possible source of intermittent AppVeyor PY27: Unable to unload AppDomain.
111-
/// FIXME: Intermittent Issue on Travis PY33: Fatal Python error: PyMUTEX_LOCK(gil_mutex) failed. Seen twice.
112-
/// </remarks>
113106
[Test]
114107
public void TestNewPyTupleFromPyTuple()
115108
{

src/runtime/pythonexception.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ public override string StackTrace
135135
/// <remarks>
136136
/// The Dispose method provides a way to explicitly release the
137137
/// Python objects represented by a PythonException.
138+
/// If object not properly disposed can cause AppDomain unload issue.
139+
/// See GH#397 and GH#400.
138140
/// </remarks>
139141
public void Dispose()
140142
{

0 commit comments

Comments
 (0)
0