Yep, will do. The test does catch it -- it's just not being executed.
I think I have a reasonable start on re-enabling surefire + Java tests
for SPARK-4159.

On Tue, Dec 9, 2014 at 10:30 PM, Aaron Davidson <aa...@databricks.com> wrote:
> Oops, that does look like a bug. Strange that the BlockTransferMessageSuite
> did not catch this. "+1" sounds like the right solution, would you be able
> to submit a PR?
>
> On Tue, Dec 9, 2014 at 1:53 PM, Sean Owen <so...@cloudera.com> wrote:
>>
>>
>> https://github.com/apache/spark/blob/master/network/shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/BlockTransferMessage.java#L70
>>
>> public byte[] toByteArray() {
>>   ByteBuf buf = Unpooled.buffer(encodedLength());
>>   buf.writeByte(type().id);
>>   encode(buf);
>>   assert buf.writableBytes() == 0 : "Writable bytes remain: " +
>> buf.writableBytes();
>>   return buf.array();
>> }
>>
>> Running the Java tests at last might have turned up a little bug here,
>> but wanted to check. This makes a buffer to hold enough bytes to
>> encode the message. But it writes 1 byte, plus the message. This makes
>> the buffer expand, and then does have nonzero capacity afterwards, so
>> the assert fails.
>>
>> So just needs a "+ 1" in the size?
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@spark.apache.org
For additional commands, e-mail: dev-h...@spark.apache.org

Reply via email to