[
https://issues.apache.org/jira/browse/COUCHDB-3261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973258#comment-15973258
]
Paul Joseph Davis commented on COUCHDB-3261:
--------------------------------------------
I'm not a fan of special casing architectures here to make the tests pass.
Looking at the actual change in data it seems that this is more than just
changing some byte ordering but that snappy is actually generating different
output on a different architecture (which is fine as long as that output is
portable between architectures).
There are two things here that I think we should change:
1. The actual test comparing compression output to a known value seems rather
wrong. I would change those tests to be more along the lines of: check
compression doesn't throw an error, check that the output is not identical to
the input, and then check that the output binary is smaller than an
uncompressed "compression". We may need to add a largish string so that we're
giving each algorithm a softball for compression to prevent silly changes in
the algorithm from breaking the unit test (as best exemplified by this case)
2. I think we should add the new s390x output to the list of various tests so
that we can verify that snappy is capable of reading its own output from
various architectures.
> Test case couch_compress_tests failed
> -------------------------------------
>
> Key: COUCHDB-3261
> URL: https://issues.apache.org/jira/browse/COUCHDB-3261
> Project: CouchDB
> Issue Type: Bug
> Components: Test Suite
> Reporter: salamani
> Labels: test
> Attachments: couch_compress_tests.patch
>
>
> CouchDB : 2.0.0
> I have built the CouchDB source for version 2.0.0.
> Test case log of couch_compress_tests:
> module 'couch_compress_tests'
> couch_compress_tests:33: compress_test_...ok
> couch_compress_tests:34: compress_test_...ok
> couch_compress_tests:35: compress_test_...*failed*
> in function couch_compress_tests:'-compress_test_/0-fun-4-'/0
> (test/couch_compress_tests.erl, line 35)
> **error:{assertEqual,[{module,couch_compress_tests},
> {line,35},
> {expression,"couch_compress : compress ( ? TERM , snappy )"},
> {expected,<<1,49,64,131,104,1,108,0,0,0,5,...>>},
> {value,<<1,49,60,131,104,1,108,0,0,0,...>>}]}
> output:<<"">>
> couch_compress_tests:40: decompress_test_...ok
> couch_compress_tests:41: decompress_test_...ok
> couch_compress_tests:42: decompress_test_...ok
> couch_compress_tests:43: decompress_test_...ok
> couch_compress_tests:48: recompress_test_...ok
> couch_compress_tests:49: recompress_test_...*failed*
> in function couch_compress_tests:'-recompress_test_/0-fun-2-'/0
> (test/couch_compress_tests.erl, line 49)
> **error:{assertEqual,[{module,couch_compress_tests},
> {line,49},
> {expression,"couch_compress : compress ( ? NONE , snappy )"},
> {expected,<<1,49,64,131,104,1,108,0,0,0,5,...>>},
> {value,<<1,49,60,131,104,1,108,0,0,0,...>>}]}
> output:<<"">>
> couch_compress_tests:50: recompress_test_...ok
> couch_compress_tests:51: recompress_test_...*failed*
> in function couch_compress_tests:'-recompress_test_/0-fun-6-'/0
> (test/couch_compress_tests.erl, line 51)
> **error:{assertEqual,[{module,couch_compress_tests},
> {line,51},
> {expression,"couch_compress : compress ( ? DEFLATE , snappy )"},
> {expected,<<1,49,64,131,104,1,108,0,0,0,5,...>>},
> {value,<<1,49,60,131,104,1,108,0,0,0,...>>}]}
> output:<<"">>
> couch_compress_tests:52: recompress_test_...ok
> couch_compress_tests:53: recompress_test_...ok
> couch_compress_tests:58: is_compressed_test_...ok
> couch_compress_tests:59: is_compressed_test_...ok
> couch_compress_tests:60: is_compressed_test_...ok
> couch_compress_tests:61: is_compressed_test_...ok
> couch_compress_tests:62: is_compressed_test_...ok
> couch_compress_tests:63: is_compressed_test_...ok
> couch_compress_tests:64: is_compressed_test_...ok
> couch_compress_tests:65: is_compressed_test_...ok
> couch_compress_tests:66: is_compressed_test_...ok
> couch_compress_tests:67: is_compressed_test_...ok
> couch_compress_tests:68: is_compressed_test_...ok
> couch_compress_tests:70: is_compressed_test_...ok
> couch_compress_tests:72: is_compressed_test_...ok
> [done in 0.078 s]
> [done in 0.078 s]
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)