Skip to content

Commit 4cba64d

Browse files
authored
HYDRA-2359 : Remove workaround on exit in several unit tests (#477)
1 parent bb093b6 commit 4cba64d

2 files changed

Lines changed: 2 additions & 42 deletions

File tree

test/lib/mayaUsd/render/mayaToHydra/testIsolateSelectMultipleInstances.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,4 @@ def test_isolateSelectMultipleInstances(self):
119119

120120

121121
if __name__ == "__main__":
122-
import platform
123-
if platform.system() == "Windows":
124-
# Logged as HYDRA-2237: Workaround for pre-existing Maya crash during
125-
# process exit on Windows. See testIsolateSelectPerShape.py for
126-
# details.
127-
import sys, ctypes, ctypes.wintypes
128-
suite = fixturesUtils.loadTestsFromDict(globals())
129-
runner = unittest.TextTestRunner(stream=sys.__stderr__, verbosity=1)
130-
results = runner.run(suite)
131-
exitCode = 0 if results.wasSuccessful() else 1
132-
sys.__stdout__.flush()
133-
sys.__stderr__.flush()
134-
kernel32 = ctypes.windll.kernel32
135-
kernel32.GetCurrentProcess.restype = ctypes.wintypes.HANDLE
136-
kernel32.TerminateProcess.argtypes = [ctypes.wintypes.HANDLE,
137-
ctypes.wintypes.UINT]
138-
kernel32.TerminateProcess(kernel32.GetCurrentProcess(), exitCode)
139-
else:
140-
fixturesUtils.runTests(globals())
122+
fixturesUtils.runTests(globals())

test/lib/mayaUsd/render/mayaToHydra/testIsolateSelectPerShape.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -212,26 +212,4 @@ def test_isolateSelectPerShape(self):
212212

213213

214214
if __name__ == "__main__":
215-
import platform
216-
if platform.system() == "Windows":
217-
# Logged as HYDRA-2237: Workaround for pre-existing Maya crash during
218-
# process exit: ufe_0.dll's static attrSubjects destructor
219-
# crashes due to DLL unload ordering. os._exit still triggers
220-
# DllMain(DLL_PROCESS_DETACH) on Windows, so we must use
221-
# TerminateProcess to kill the process without running any DLL
222-
# teardown. Test results are fully reported by the runner
223-
# before this point.
224-
import sys, unittest, ctypes, ctypes.wintypes
225-
suite = fixturesUtils.loadTestsFromDict(globals())
226-
runner = unittest.TextTestRunner(stream=sys.__stderr__, verbosity=1)
227-
results = runner.run(suite)
228-
exitCode = 0 if results.wasSuccessful() else 1
229-
sys.__stdout__.flush()
230-
sys.__stderr__.flush()
231-
kernel32 = ctypes.windll.kernel32
232-
kernel32.GetCurrentProcess.restype = ctypes.wintypes.HANDLE
233-
kernel32.TerminateProcess.argtypes = [ctypes.wintypes.HANDLE,
234-
ctypes.wintypes.UINT]
235-
kernel32.TerminateProcess(kernel32.GetCurrentProcess(), exitCode)
236-
else:
237-
fixturesUtils.runTests(globals())
215+
fixturesUtils.runTests(globals())

0 commit comments

Comments
 (0)