Deadlock / missed messages in launch test.

Aperta
#648 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
testing-qa

Direzione di ricerca

Inizia riproducendo il caso TestRobotConductor fornito con colcon test e pytest, quindi confrontalo con l'esecuzione del test come script. Traccia l'attesa di executor.spin_until_future_complete e le chiamate al servizio in conductor.collect_calibration_data; il lavoro è completato quando il launch test non va più in deadlock né perde messaggi e il future viene completato in modo affidabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04.1 LTS
  • Installation type:
    • Binaries
  • Version or commit hash:
    • ros:humble-ros-core-jammy docker image
  • DDS implementation:
    • Fast DDS.
  • Client library (if applicable):
    • rclpy
Steps to reproduce issue

Below is the test I am tying to run. I also have a generate_test_description section which spins up 4 other nodes. When I run my test with colcon test and pytest, the test runs for a while but eventually fails when a future does not finish (using executor.spin_until_future_complete). However, if I bring up all the other nodes manually and then run the below test as a script, everything always works as expected. As far as I can tell, the conductor.collect_calibration_data function below, which makes a bunch of service calls, sends a request that is never received by the server, or never receives a response from the server that appear to have been sent.

class TestRobotConductor(unittest.TestCase):
    def setUp(self):
        rclpy.init()
        self.node = rclpy.create_node("test_robot_conductor")
        self.executor = rclpy.executors.MultiThreadedExecutor()
        self.executor.add_node(self.node)
        self.executor_thread = threading.Thread(target=self.executor.spin, daemon=True)
        self.executor_thread.start()
        self.cam_cal_client = CamCalClient(self.node, self.executor)

    def tearDown(self):
        self.node.destroy_node()
        self.executor.shutdown()
        rclpy.shutdown()

    def test_robot_conductor(self):
        self.cam_cal_client.wait_for_services(timeout_sec=5.0)
        conductor = RobotConductor(self.cam_cal_client)
        conductor.collect_calibration_data()
        response = conductor.execute_cal()
Lingua principale
Python
Stelle
156
Fork
200
Merge medio
2g 11h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ros2/launch

Tutte le issue di ros2/launch

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.