Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4334

Test Failure - test_heartbeat_start_ordering fails occasionally

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      test_heartbeat_start_ordering fails occasionally, this one happened on PyPy in github actions:

      =================================== FAILURES ===================================
      ___________ TestHeartbeatStartOrdering.test_heartbeat_start_ordering ___________
      
      self = <test.test_discovery_and_monitoring.TestHeartbeatStartOrdering testMethod=test_heartbeat_start_ordering>
      
          def test_heartbeat_start_ordering(self):
              events = []
              listener = HeartbeatEventsListListener(events)
              server_thread = threading.Thread(target=self.start_server, args=(events,))
              server_thread.start()
              _c = MongoClient(
                  "mongodb://localhost:9999", serverSelectionTimeoutMS=500, event_listeners=(listener,)
              )
              server_thread.join()
              listener.wait_for_event(ServerHeartbeatStartedEvent, 1)
              listener.wait_for_event(ServerHeartbeatFailedEvent, 1)
          
      >       self.assertEqual(
                  events,
                  [
                      "serverHeartbeatStartedEvent",
                      "client connected",
                      "client hello received",
                      "serverHeartbeatFailedEvent",
                  ],
              )
      E       AssertionError: Lists differ: ['ser[23 chars]t', 'serverHeartbeatFailedEvent', 'serverHeart[88 chars]ent'] != ['ser[23 chars]t', 'client connected', 'client hello received[27 chars]ent']
      E       
      E       First differing element 1:
      E       'serverHeartbeatFailedEvent'
      E       'client connected'
      E       
      E       First list contains 2 additional elements.
      E       First extra element 4:
      E       'client hello received'
      E       
      E         ['serverHeartbeatStartedEvent',
      E       -  'serverHeartbeatFailedEvent',
      E       -  'serverHeartbeatStartedEvent',
      E          'client connected',
      E          'client hello received',
      E          'serverHeartbeatFailedEvent']
      
      test/test_discovery_and_monitoring.py:430: AssertionError
      

      https://github.com/mongodb/mongo-python-driver/actions/runs/8605017509/job/23580360068#step:7:4554

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: