flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NicoK <...@git.apache.org>
Subject [GitHub] flink pull request #4552: [FLINK-7456][network] Implement Netty sender incom...
Date Mon, 15 Jan 2018 17:35:00 GMT
Github user NicoK commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4552#discussion_r161569135
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartitionTest.java
---
    @@ -134,13 +135,22 @@ public void testBasicPipelinedProduceConsumeLogic() throws Exception
{
     		assertEquals(2 * BUFFER_SIZE, subpartition.getTotalNumberOfBytes());
     		verify(listener, times(2)).notifyBuffersAvailable(eq(1L));
     
    +		assertFalse(view.nextBufferIsEvent());
    +		read = view.getNextBuffer();
    +		assertNotNull(read);
    +		assertEquals(0, subpartition.getBuffersInBacklog());
    +		assertEquals(subpartition.getBuffersInBacklog(), read.buffersInBacklog());
    +		assertNull(view.getNextBuffer());
    +		assertEquals(0, subpartition.getBuffersInBacklog());
    +
     		// Add event to the queue...
     		Buffer event = createBuffer();
     		event.tagAsEvent();
     		subpartition.add(event);
     
    +		assertTrue(view.nextBufferIsEvent());
     		assertEquals(3, subpartition.getTotalNumberOfBuffers());
    -		assertEquals(1, subpartition.getBuffersInBacklog());
    +		assertEquals(0, subpartition.getBuffersInBacklog());
     		assertEquals(3 * BUFFER_SIZE, subpartition.getTotalNumberOfBytes());
     		verify(listener, times(3)).notifyBuffersAvailable(eq(1L));
     	}
    --- End diff --
    
    maybe verify that `nextBufferIsEvent()` returns the right thing after adding a real buffer
now (with the event being next)


---

Mime
View raw message