simbadzina commented on PR #5951:
URL: https://github.com/apache/hadoop/pull/5951#issuecomment-1681305358

   I've created a unit test here: 
https://github.com/simbadzina/hadoop/pull/1/commits/d216bfe8c5f506f08263cf490479a0398b097f05
   
   ```
     /**
      * Verify that stateID is received into call before
      * call is notified.
      * @throws IOException
      */
     @Test(timeout=60000)
     public void testReceiveStateBeforeCallerNotification() throws IOException {
       AtomicBoolean stateReceived = new AtomicBoolean(false);
       AlignmentContext alignmentContext = Mockito.mock(AlignmentContext.class);
       Mockito.doAnswer((Answer<Void>) invocation -> {
         Thread.sleep(1000);
         stateReceived.set(true);
         return null;
       }).when(alignmentContext)
           
.receiveResponseState(any(RpcHeaderProtos.RpcResponseHeaderProto.class));
   
       final Client client = Mockito.spy(new Client(LongWritable.class, conf));
       final TestServer server = new TestServer(1, false);
   
       try {
         InetSocketAddress addr = NetUtils.getConnectAddress(server);
         server.start();
         call(client, new LongWritable(RANDOM.nextLong()), addr,
             0, conf, alignmentContext);
         Assert.assertTrue(stateReceived.get());
       } finally {
         client.stop();
         server.stop();
       }
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to