changeset 147:ff788c99f1aa

test_lua_deadlock
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 16 Jul 2018 11:19:42 +0200
parents 5ba7b2417544
children 8c0dcd3ec458
files Tests/Tests.py
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Tests/Tests.py	Fri Jul 13 16:40:18 2018 +0200
+++ b/Tests/Tests.py	Mon Jul 16 11:19:42 2018 +0200
@@ -3770,3 +3770,27 @@
         self.assertEqual('1.2.840.10008.5.1.4.1.1.4', m['SopClassUid'])
         self.assertEqual('1', m['IndexInSeries'])
         self.assertTrue('ReceptionDate' in m)
+
+
+    def test_lua_deadlock(self):
+        # Rana Asim Wajid (2018-07-14): "It does seem that the issue
+        # is with the lua script I'm using for conversion of images to
+        # JPEG2000. When the script is used with 1.4.0 the first
+        # instance appears to be stored and then everything just
+        # halts, ie Orthanc wont respond to anything after that."
+        # https://groups.google.com/d/msg/orthanc-users/Rc-Beb42xc8/JUgdzrmCAgAJ
+        InstallLuaScript('Lua/Jpeg2000Conversion.lua')
+
+        subprocess.check_call([ FindExecutable('storescu'),
+                                _REMOTE['Server'], str(_REMOTE['DicomPort']),
+                                GetDatabasePath('Brainix/Flair/IM-0001-0001.dcm'),
+                                GetDatabasePath('Brainix/Flair/IM-0001-0002.dcm'),
+                                ])
+
+        instances = DoGet(_REMOTE, '/instances')
+        self.assertEqual(2, len(instances))
+
+        t1 = DoGet(_REMOTE, '/instances/%s/metadata/TransferSyntax' % instances[0])
+        t2 = DoGet(_REMOTE, '/instances/%s/metadata/TransferSyntax' % instances[1])
+        self.assertEqual('1.2.840.10008.1.2.4.90', t1)
+        self.assertEqual(t1, t2);