Skip to content

Commit 9b4558d

Browse files
committed
[chores] Ignore library errors
1 parent f8838c9 commit 9b4558d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

openwisp_network_topology/tests/test_realtime.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TestRealTime(
4141
application = import_string(getattr(settings, "ASGI_APPLICATION"))
4242
browser = "chrome"
4343
maxDiff = None
44-
retry_max = 8
44+
retry_max = 6
4545

4646
def setUp(self):
4747
org = self._create_org()
@@ -107,6 +107,12 @@ def _assert_no_js_errors(self):
107107
# ignore if not console-api
108108
if log["source"] != "console-api":
109109
continue
110+
# ignore errors coming from the library
111+
# to reduce flakyness, if there's really
112+
# a sever error the UI will not work as expected
113+
if "/static/netjsongraph/js/src/netjsongraph.min.js" in log["message"]:
114+
print(f"ignoring library error: {log}")
115+
continue
110116
else:
111117
print(log)
112118
browser_logs.append(log)
@@ -232,6 +238,7 @@ async def test_non_admin_visualizer(self):
232238
]["status"],
233239
"down",
234240
)
241+
self._assert_no_js_errors()
235242
# removing a link from the DB will remove it from the UI
236243
with self.subTest("remove link"):
237244
await database_sync_to_async(self.link.delete)()
@@ -242,6 +249,7 @@ async def test_non_admin_visualizer(self):
242249
len(self.web_driver.execute_script("return graph.data;")["links"]),
243250
0,
244251
)
252+
self._assert_no_js_errors()
245253
# creating a new node will add it to the UI
246254
with self.subTest("add node"):
247255
await database_sync_to_async(self._create_node3)()
@@ -252,4 +260,5 @@ async def test_non_admin_visualizer(self):
252260
len(self.web_driver.execute_script("return graph.data;")["nodes"]),
253261
3,
254262
)
263+
self._assert_no_js_errors()
255264
await communicator.disconnect()

0 commit comments

Comments
 (0)