Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-15639

Investigate ConsumerNetworkThreadTest's testResetPositionsProcessFailureIsIgnored

    XMLWordPrintableJSON

Details

    Description

      The testResetPositionsProcessFailureIsIgnored test looks like this:

       

          @Test
          public void testResetPositionsProcessFailureIsIgnored() {
              doThrow(new NullPointerException()).when(offsetsRequestManager).resetPositionsIfNeeded();
      
              ResetPositionsApplicationEvent event = new ResetPositionsApplicationEvent();
              applicationEventsQueue.add(event);
              assertDoesNotThrow(() -> consumerNetworkThread.runOnce());
      
              verify(applicationEventProcessor).process(any(ResetPositionsApplicationEvent.class));
          }
       

       

      junrao asks:

       

      Not sure if this is a useful test since offsetsRequestManager.resetPositionsIfNeeded() seems to never directly throw an exception?

       

      I commented out the doThrow line and it did not impact the test. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            kirktrue Kirk True
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: