Repository: AgnostiqHQ/covalent (language: python)

Issue:
Lattice JSON serialization test fails randomly
The lattice JSON serialization test (`test_lattice_json_serialization`) fails randomly. This is because Lattice has an attribute `cova_imports` which is a Python set, and serialization converts the set to a list. However, the list order is not deterministic.

Work around this by setting `cova_imports` to a singleton for the purposes of the test.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 738073547..428afa44c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [UNRELEASED]
 
+### Tests
+
+- Fixed randomly failing lattice json serialization test
+
 ## [0.164.0] - 2022-08-05
 
 ### Authors


Test patch:
diff --git a/tests/covalent_tests/workflow/lattice_serialization_test.py b/tests/covalent_tests/workflow/lattice_serialization_test.py
index dff4b16b1..c3a57faf4 100644
--- a/tests/covalent_tests/workflow/lattice_serialization_test.py
+++ b/tests/covalent_tests/workflow/lattice_serialization_test.py
@@ -20,18 +20,22 @@
 
 import covalent as ct
 from covalent._workflow.lattice import Lattice
+from covalent.executor import LocalExecutor
+
+le = LocalExecutor(log_stdout="/tmp/stdout.log")
 
 
 def test_lattice_json_serialization():
-    @ct.electron(executor="local", deps_bash=ct.DepsBash("yum install gcc"))
+    @ct.electron(executor="le", deps_bash=ct.DepsBash("yum install gcc"))
     def f(x):
         return x * x
 
-    @ct.lattice
+    @ct.lattice(executor="le")
     def workflow(x):
         return f(x)
 
     workflow.build_graph(5)
+    workflow.cova_imports = set("dummy_module")
 
     json_workflow = workflow.serialize_to_json()