kytos-ng / sdntrace

Napp that traces OpenFlow paths in the dataplane
https://kytos-ng.github.io/api/sdntrace.html
GNU Lesser General Public License v3.0
0 stars 5 forks source link

Exception warning in tests #79

Open Alopalao opened 1 month ago

Alopalao commented 1 month ago

Test results from tox show an exception:

tests/unit/tracing/test_trace_manager.py::TestTraceManager::test_is_entry_invalid_not_colored
  /home/aldo/Desktop/testing/sdntrace/.tox/py311/lib/python3.11/site-packages/_pytest/unraisableexception.py:80: PytestUnraisableExceptionWarning: Exception ignored in thread started by: <bound method TraceManager._spawn_trace of <napps.amlight.sdntrace.tracing.trace_manager.TraceManager object at 0x7f59d21a4750>>

  Traceback (most recent call last):
    File "/home/aldo/Desktop/testing/sdntrace/.tox/py311/var/lib/kytos/napps/amlight/sdntrace/tracing/trace_manager.py", line 100, in _spawn_trace
      tracer = TracePath(self, trace_id, trace_entries)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/aldo/Desktop/testing/sdntrace/.tox/py311/var/lib/kytos/napps/amlight/sdntrace/tracing/tracer.py", line 47, in __init__
      self.init_switch = self.get_init_switch()
                         ^^^^^^^^^^^^^^^^^^^^^^
    File "/home/aldo/Desktop/testing/sdntrace/.tox/py311/var/lib/kytos/napps/amlight/sdntrace/tracing/tracer.py", line 56, in get_init_switch
      return Switches().get_switch(self.init_entries.dpid)
                                   ^^^^^^^^^^^^^^^^^^^^^^
  AttributeError: 'str' object has no attribute 'dpid'

Appears to be not from the test test_is_entry_invalid_not_colored but from a running thread created by TestManager initializer. Some test process is creating entries with dpid as an string value.

Alopalao commented 2 days ago

Found the problem being async def test_get_stats() from test_main.py. The strings tried to be used as objects are trace1 and trace2.