You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Joe Stein <cr...@gmail.com> on 2011/11/06 05:22:15 UTC

CompressionUtilTest does not run and fails when it does

CompressionUtilTest does not run the functions inside of it during ./sbt
test

if you change CompressionUtilTest to extend JUnitSuite then the existing
functions run (once you adorne them with @Test) but then fail ...

I suspect the TestUtils.checkEquals(messages.iterator,
decompressedMessages.iterator) is failing in testSimpleCompressDecompress
because all of the messages are serialized into byte arrays and the entire
set of messages compressed and that new compressed messages is what is
returned as one message instead of the List[Message] and therefor are not
interpreted within TestUtil.checkEquals to see this nuance.

e.g.

[error] Test Failed: testSimpleCompressDecompress
junit.framework.AssertionFailedError: expected:<message(magic = 1,
attributes = 0, crc = 3819140844, payload = java.nio.HeapByteBuffer[pos=0
lim=8 cap=8])> but was:<MessageAndOffset(message(magic = 1, attributes = 0,
crc = 3819140844, payload = java.nio.HeapByteBuffer[pos=0 lim=8 cap=8]),18)>

and

[error] Test Failed: testComplexCompressDecompress
junit.framework.AssertionFailedError: expected:<2> but was:<3>

Before opening a JIRA just wanted to check if maybe there was something
that I was missing?

/*
Joe Stein
http://www.linkedin.com/in/charmalloc
Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
*/

Re: CompressionUtilTest does not run and fails when it does

Posted by Joe Stein <cr...@gmail.com>.
ok

On Sun, Nov 6, 2011 at 1:40 AM, Neha Narkhede <ne...@gmail.com>wrote:

> Joe,
>
> Nice catch! This looks like a bug in the unit test. Do you want to
> file a JIRA and submit a patch ?
>
> Thanks,
> Neha
>
> On Sat, Nov 5, 2011 at 9:22 PM, Joe Stein <cr...@gmail.com> wrote:
> > CompressionUtilTest does not run the functions inside of it during ./sbt
> > test
> >
> > if you change CompressionUtilTest to extend JUnitSuite then the existing
> > functions run (once you adorne them with @Test) but then fail ...
> >
> > I suspect the TestUtils.checkEquals(messages.iterator,
> > decompressedMessages.iterator) is failing in testSimpleCompressDecompress
> > because all of the messages are serialized into byte arrays and the
> entire
> > set of messages compressed and that new compressed messages is what is
> > returned as one message instead of the List[Message] and therefor are not
> > interpreted within TestUtil.checkEquals to see this nuance.
> >
> > e.g.
> >
> > [error] Test Failed: testSimpleCompressDecompress
> > junit.framework.AssertionFailedError: expected:<message(magic = 1,
> > attributes = 0, crc = 3819140844, payload = java.nio.HeapByteBuffer[pos=0
> > lim=8 cap=8])> but was:<MessageAndOffset(message(magic = 1, attributes =
> 0,
> > crc = 3819140844, payload = java.nio.HeapByteBuffer[pos=0 lim=8
> cap=8]),18)>
> >
> > and
> >
> > [error] Test Failed: testComplexCompressDecompress
> > junit.framework.AssertionFailedError: expected:<2> but was:<3>
> >
> > Before opening a JIRA just wanted to check if maybe there was something
> > that I was missing?
> >
> > /*
> > Joe Stein
> > http://www.linkedin.com/in/charmalloc
> > Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
> > */
> >
>



-- 

/*
Joe Stein
http://www.linkedin.com/in/charmalloc
Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
*/

Re: CompressionUtilTest does not run and fails when it does

Posted by Neha Narkhede <ne...@gmail.com>.
Joe,

Nice catch! This looks like a bug in the unit test. Do you want to
file a JIRA and submit a patch ?

Thanks,
Neha

On Sat, Nov 5, 2011 at 9:22 PM, Joe Stein <cr...@gmail.com> wrote:
> CompressionUtilTest does not run the functions inside of it during ./sbt
> test
>
> if you change CompressionUtilTest to extend JUnitSuite then the existing
> functions run (once you adorne them with @Test) but then fail ...
>
> I suspect the TestUtils.checkEquals(messages.iterator,
> decompressedMessages.iterator) is failing in testSimpleCompressDecompress
> because all of the messages are serialized into byte arrays and the entire
> set of messages compressed and that new compressed messages is what is
> returned as one message instead of the List[Message] and therefor are not
> interpreted within TestUtil.checkEquals to see this nuance.
>
> e.g.
>
> [error] Test Failed: testSimpleCompressDecompress
> junit.framework.AssertionFailedError: expected:<message(magic = 1,
> attributes = 0, crc = 3819140844, payload = java.nio.HeapByteBuffer[pos=0
> lim=8 cap=8])> but was:<MessageAndOffset(message(magic = 1, attributes = 0,
> crc = 3819140844, payload = java.nio.HeapByteBuffer[pos=0 lim=8 cap=8]),18)>
>
> and
>
> [error] Test Failed: testComplexCompressDecompress
> junit.framework.AssertionFailedError: expected:<2> but was:<3>
>
> Before opening a JIRA just wanted to check if maybe there was something
> that I was missing?
>
> /*
> Joe Stein
> http://www.linkedin.com/in/charmalloc
> Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
> */
>