MyTooliT / ICOc

ICOc is a tool to control the ICOtronic system, acquire data, and test stationary transceiver units and sensory tool holders.
https://mytoolit.github.io/ICOc/
2 stars 0 forks source link

STH Test: Connection Test Fails on Working Hardware #15

Closed sanssecours closed 3 years ago

sanssecours commented 3 years ago

Description

Sometimes the STH connection test fails, even if we use working STH hardware. This does only happen very infrequently though.

Steps to Reproduce

Run the whole STH test:

test-sth

or only the connection test

test-sth -k connection

Make sure you use a correctly working STU and STH.

Expected Result

The STH test reports no problems

Actual Result

The connection test fails:

======================================================================
FAIL: test_connection (mytoolit.test.production.sth.TestSTH)
Check connection to STH
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\users\rene\documents\projects\icoc\mytoolit\test\production\sth.py", line 146, in test_connection
    self._test_connection()
  File "c:\users\rene\documents\projects\icoc\mytoolit\test\production\node.py", line 281, in _test_connection
    self.assertEqual(
AssertionError: 32847 != 181327 : Expected CAN identifier [STH 1 → SPU 1, Block: System, Command: ActiveState, Acknowledge] does not match received CAN identifier [STU 1 → SPU 1, Block: System, Command: Bluetooth, Acknowledge]

----------------------------------------------------------------------
Ran 7 tests in 63.465s

Possible Workaround/Solution

sanssecours commented 3 years ago

In theory this problem should be fixed in commit e61534d5. We still need a small delay though. Otherwise it is possible that the STH is still in the Startup state, although the test expects that the STH reports that it is in the Operating state.