Skip to content

Commit

Permalink
Adds test attempting to run a shared memory graph. Should raise error…
Browse files Browse the repository at this point in the history
… in python < 3.8
  • Loading branch information
pritchardn committed Jan 7, 2022
1 parent 03eac3d commit 2a2b6f1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions daliuge-engine/test/manager/test_dm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#
import copy
import os
import sys
import threading
import unittest
from time import sleep
Expand Down Expand Up @@ -611,6 +612,23 @@ def test_run_streaming_consumer_remotely2(self):
e_data = str(crc32c(a_data, 0)).encode('utf8')
self._test_runGraphInTwoNMs(g1, g2, rels, a_data, e_data, leaf_oid="E")

def test_run_invalid_shmem_graph(self):
"""
Our shared memory implementation does not support Python < 3.7
This test asserts that a graph containing shared memory drops will not run if running
in python < 3.8, and that it *does* run with python >= 3.8
"""

graph = [{"oid": "A", "type": "plain", "storage": Categories.SHMEM}]
dm = self._start_dm()
sessionID = "s1"
if sys.version_info < (3, 8):
self.assertRaises(NotImplementedError, quickDeploy(dm, sessionID, graph))
else:
quickDeploy(dm, sessionID, graph)
self.assertEqual(1, len(dm._sessions[sessionID].drops))
dm.destroySession(sessionID)


@unittest.skipIf(multiprocessing.cpu_count() < 4, "Not enough threads to test multiprocessing")
class TestDMParallel(NMTestsMixIn, unittest.TestCase):
Expand Down

0 comments on commit 2a2b6f1

Please sign in to comment.