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 #4559: [FLINK-7468][network] Implement sender backlog log...
Date Mon, 18 Dec 2017 17:33:25 GMT
Github user NicoK commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4559#discussion_r157538061
  
    --- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartitionTest.java
---
    @@ -103,16 +104,35 @@ public void testBasicPipelinedProduceConsumeLogic() throws Exception
{
     		// Add data to the queue...
     		subpartition.add(createBuffer());
     
    +		assertEquals(1, subpartition.getTotalNumberOfBuffers());
    +		assertEquals(1, subpartition.getBuffersInBacklog());
    +		assertEquals(BUFFER_SIZE, subpartition.getTotalNumberOfBytes());
    +
     		// ...should have resulted in a notification
     		verify(listener, times(1)).notifyBuffersAvailable(eq(1L));
     
     		// ...and one available result
     		assertNotNull(view.getNextBuffer());
     		assertNull(view.getNextBuffer());
    +		assertEquals(0, subpartition.getBuffersInBacklog());
     
     		// Add data to the queue...
     		subpartition.add(createBuffer());
    +
    +		assertEquals(2, subpartition.getTotalNumberOfBuffers());
    +		assertEquals(1, subpartition.getBuffersInBacklog());
    +		assertEquals(2 * BUFFER_SIZE, subpartition.getTotalNumberOfBytes());
     		verify(listener, times(2)).notifyBuffersAvailable(eq(1L));
    +
    +		// Add event to the queue...
    +		Buffer event = createBuffer();
    +		event.tagAsEvent();
    +		subpartition.add(event);
    +
    +		assertEquals(3, subpartition.getTotalNumberOfBuffers());
    +		assertEquals(1, subpartition.getBuffersInBacklog());
    --- End diff --
    
    good catch - the event-adding path was not tested yet


---

Mime
View raw message