intersystems-community / embedded-python-bugreports

Please submit bugs you found in Embedded Python here
0 stars 1 forks source link

Something is wrong with transactions #6

Open daimor opened 1 year ago

daimor commented 1 year ago

with ipm wrapper as a workaround for #5 from here https://github.com/intersystems-community/zpm-dockerhub/blob/master/iris_ipm.py

Emoty UnitTest randomly fails with error A test left a transactions suspended

image
>>> iris.ipm('test demo -v -only')

[USER|demo]     Test START
Load of directory started on 09/08/2023 11:25:17
Loading file /home/irisowner/app/tests/test/dc.cls as cls
Imported class: test.dc
Load finished successfully.

Compilation started on 09/08/2023 11:25:17 with qualifiers 'ckd'
Compiling class test.dc
Compiling routine test.dc.1
Compilation finished successfully in 0.008s.

===============================================================================
Directory: /home/irisowner/app/tests/test/
===============================================================================
  (root) begins ...
Load of directory started on 09/08/2023 11:25:17 '*.xml;*.XML;*.cls;*.mac;*.int;*.inc;*.CLS;*.MAC;*.INT;*.INC'

Loading file /home/irisowner/app/tests/test/dc.cls as udl

Compilation started on 09/08/2023 11:25:17 with qualifiers '/display=all/nodelete'
Compiling class test.dc
Compiling routine test.dc.1
Compilation finished successfully in 0.007s.

Load finished successfully.

    test.dc begins ...
      TestNothing() begins ...
        LogMessage:Duration of execution: .000002 sec.
      TestNothing passed
LogStateStatus:0:Cleanup: ERROR #5001: A test left a transactions suspended  <<==== **FAILED**   (root):test.dc:
    test.dc failed
  Skipping deleting classes 
  (root) failed

Use the following URL to view the result:
http://172.17.0.4:52773/csp/sys/%25UnitTest.Portal.Indices.cls?Index=14&$NAMESPACE=USER
Some tests FAILED in suites:

[demo]  Test FAILURE
ERROR! 1 test suite(s) failed.

module.xml

<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
  <Document name="demo.ZPM">
    <Module>
      <Name>demo</Name>
      <Version>1.0.0</Version>
      <Keywords>demo</Keywords>
      <Description>demo</Description>
      <Packaging>module</Packaging>
      <SourcesRoot>src</SourcesRoot>
      <UnitTest Name="/tests/" Package="test" Phase="test"/>
    </Module>
  </Document>
</Export>

test class tests/test/dc.cls

Class test.dc Extends %UnitTest.TestCase
{

Method TestNothing()
{
}

}
grongierisc commented 1 year ago

Reproduce on :

iris @ https://github.com/grongierisc/iris-embedded-python-wrapper/releases/download/v0.0.4/iris-0.0.4-py3-none-any.whl
>>> ipm('test demo -v -only')

[IRISAPP|demo]  Test START
Load of directory started on 09/08/2023 13:58:50
Loading file /irisdev/app/test/tests/test.cls as cls
Imported class: test.tests.test
Load finished successfully.

Compilation started on 09/08/2023 13:58:50 with qualifiers 'ckd'
Compiling 3 classes
Compiling class test.dc
Compiling class test.demo
Compiling class test.tests.test
Compiling routine test.dc.1
Compiling routine test.tests.test.1
Compilation finished successfully in 0.049s.

Use the following URL to view the result:
http://172.27.0.2:52773/csp/sys/%25UnitTest.Portal.Indices.cls?Index=15&$NAMESPACE=IRISAPP
All PASSED

[IRISAPP|demo]  Test SUCCESS
True
>>> ipm('test demo -v -only')

[IRISAPP|demo]  Test START
Load of directory started on 09/08/2023 13:58:52
Loading file /irisdev/app/test/tests/test.cls as cls
Imported class: test.tests.test
Load finished successfully.

Compilation started on 09/08/2023 13:58:52 with qualifiers 'ckd'
Compiling 3 classes
Compiling class test.demo
Compiling class test.dc
Compiling class test.tests.test
Compiling routine test.dc.1
Compiling routine test.tests.test.1
Compilation finished successfully in 0.036s.

Use the following URL to view the result:
http://172.27.0.2:52773/csp/sys/%25UnitTest.Portal.Indices.cls?Index=16&$NAMESPACE=IRISAPP
All PASSED
ERROR closing %ZPM.PackageManager.Developer.UnitTest.Manager

ERROR #5001: A test left a transactions suspended

[IRISAPP|demo]  Test SUCCESS
True

>>> ipm('test demo -v -only')

[IRISAPP|demo]  Test START
Load of directory started on 09/08/2023 13:58:50
Loading file /irisdev/app/test/tests/test.cls as cls
Imported class: test.tests.test
Load finished successfully.

Compilation started on 09/08/2023 13:58:50 with qualifiers 'ckd'
Compiling 3 classes
Compiling class test.dc
Compiling class test.demo
Compiling class test.tests.test
Compiling routine test.dc.1
Compiling routine test.tests.test.1
Compilation finished successfully in 0.049s.

Use the following URL to view the result:
http://172.27.0.2:52773/csp/sys/%25UnitTest.Portal.Indices.cls?Index=15&$NAMESPACE=IRISAPP
All PASSED

[IRISAPP|demo]  Test SUCCESS
True
>>> ipm('test demo -v -only')

[IRISAPP|demo]  Test START
Load of directory started on 09/08/2023 13:58:52
Loading file /irisdev/app/test/tests/test.cls as cls
Imported class: test.tests.test
Load finished successfully.

Compilation started on 09/08/2023 13:58:52 with qualifiers 'ckd'
Compiling 3 classes
Compiling class test.demo
Compiling class test.dc
Compiling class test.tests.test
Compiling routine test.dc.1
Compiling routine test.tests.test.1
Compilation finished successfully in 0.036s.

Use the following URL to view the result:
http://172.27.0.2:52773/csp/sys/%25UnitTest.Portal.Indices.cls?Index=16&$NAMESPACE=IRISAPP
All PASSED

[IRISAPP|demo]  Test SUCCESS
True
daimor commented 1 year ago

In my case, I had to run it multiple times in a row, to see it