# HG changeset patch # User Sebastien Jodogne # Date 1531732782 -7200 # Node ID ff788c99f1aa9b319086a72fece8af7018289637 # Parent 5ba7b2417544ff3faec4fd87ecc914334941ae8f test_lua_deadlock diff -r 5ba7b2417544 -r ff788c99f1aa Tests/Tests.py --- 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);