facebook / wangle

Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.
Apache License 2.0
3.04k stars 536 forks source link

Question about CodecTest #91

Closed msteinert closed 7 years ago

msteinert commented 7 years ago

I'm not sure if this is a real issue but it is bothering me.

When I run the test suite via ctest or make test I get a single failure in CodecTest:

$ ctest -R CodecTest
Test project /home/msteinert/src/git/wangle/wangle/_build
    Start 12: CodecTest
1/1 Test #12: CodecTest ........................***Failed    0.02 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.03 sec

The following tests FAILED:
         12 - CodecTest (Failed)
Errors while running CTest

This is the relevant portion of the log file:

[ RUN      ] LineBasedFrameDecoder.Fail                                                                                                                                       
W0314 10:02:59.123875 19881 Pipeline-inl.h:165] No outbound handler in Pipeline, outbound operations will throw std::invalid_argument                                         
/home/msteinert/src/git/wangle/wangle/codec/CodecTest.cpp:537: Failure                                                                                                        
      Expected: nullptr                                                                                                                                                       
      Which is: 8-byte object <00-00 00-00 00-00 00-00>                                                                                                                       
To be equal to: buf                                                                                                                                                           
      Which is: 8-byte object <68-3F B7-00 00-00 00-00>                                                                                                                       
[  FAILED  ] LineBasedFrameDecoder.Fail (0 ms)

Running this test manually is fine though:

$ ./bin/CodecTest --gtest_filter=LineBasedFrameDecoder.Fail
Running main() from gmock_main.cc
Note: Google Test filter = LineBasedFrameDecoder.Fail
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from LineBasedFrameDecoder
[ RUN      ] LineBasedFrameDecoder.Fail
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0314 10:07:41.680444 22984 Pipeline-inl.h:165] No outbound handler in Pipeline, outbound operations will throw std::invalid_argument
[       OK ] LineBasedFrameDecoder.Fail (0 ms)
[----------] 1 test from LineBasedFrameDecoder (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (0 ms total)
[  PASSED  ] 1 test.

Relevant test code: https://github.com/facebook/wangle/blob/master/wangle/codec/CodecTest.cpp#L530-L576

Is there a bug here or am I doing something wrong?

331527583 commented 7 years ago

I also have this.and belowe this ,i paste the 'LastTest.log' file.

12/22 Testing: CodecTest 12/22 Test: CodecTest Command: "/home/cxh/wangle-2017.05.15.00/wangle/build/bin/CodecTest" Directory: /home/cxh/wangle-2017.05.15.00/wangle/build "CodecTest" start time: Jun 12 10:08 CST Output:

[==========] Running 18 tests from 5 test cases. [----------] Global test environment set-up. [----------] 1 test from FixedLengthFrameDecoder [ RUN ] FixedLengthFrameDecoder.FailWhenLengthFieldEndOffset [ OK ] FixedLengthFrameDecoder.FailWhenLengthFieldEndOffset (5 ms) [----------] 1 test from FixedLengthFrameDecoder (5 ms total)

[----------] 2 tests from LengthFieldFramePipeline [ RUN ] LengthFieldFramePipeline.SimpleTest [ OK ] LengthFieldFramePipeline.SimpleTest (0 ms) [ RUN ] LengthFieldFramePipeline.LittleEndian [ OK ] LengthFieldFramePipeline.LittleEndian (1 ms) [----------] 2 tests from LengthFieldFramePipeline (1 ms total)

[----------] 9 tests from LengthFieldFrameDecoder [ RUN ] LengthFieldFrameDecoder.Simple [ OK ] LengthFieldFrameDecoder.Simple (0 ms) [ RUN ] LengthFieldFrameDecoder.NoStrip [ OK ] LengthFieldFrameDecoder.NoStrip (0 ms) [ RUN ] LengthFieldFrameDecoder.Adjustment [ OK ] LengthFieldFrameDecoder.Adjustment (1 ms) [ RUN ] LengthFieldFrameDecoder.PreHeader [ OK ] LengthFieldFrameDecoder.PreHeader (0 ms) [ RUN ] LengthFieldFrameDecoder.PostHeader [ OK ] LengthFieldFrameDecoder.PostHeader (0 ms) [ RUN ] LengthFieldFrameDecoder.StripPrePostHeaderFrameInclHeader [ OK ] LengthFieldFrameDecoder.StripPrePostHeaderFrameInclHeader (0 ms) [ RUN ] LengthFieldFrameDecoder.FailTestLengthFieldEndOffset [ OK ] LengthFieldFrameDecoder.FailTestLengthFieldEndOffset (0 ms) [ RUN ] LengthFieldFrameDecoder.FailTestLengthFieldFrameSize [ OK ] LengthFieldFrameDecoder.FailTestLengthFieldFrameSize (0 ms) [ RUN ] LengthFieldFrameDecoder.FailTestLengthFieldInitialBytes [ OK ] LengthFieldFrameDecoder.FailTestLengthFieldInitialBytes (0 ms) [----------] 9 tests from LengthFieldFrameDecoder (2 ms total)

[----------] 1 test from LengthFieldFrameDecoderStrip [ RUN ] LengthFieldFrameDecoderStrip.PrePostHeader [ OK ] LengthFieldFrameDecoderStrip.PrePostHeader (0 ms) [----------] 1 test from LengthFieldFrameDecoderStrip (0 ms total)

[----------] 5 tests from LineBasedFrameDecoder [ RUN ] LineBasedFrameDecoder.Simple [ OK ] LineBasedFrameDecoder.Simple (0 ms) [ RUN ] LineBasedFrameDecoder.SaveDelimiter [ OK ] LineBasedFrameDecoder.SaveDelimiter (0 ms) [ RUN ] LineBasedFrameDecoder.Fail /home/cxh/wangle-2017.05.15.00/wangle/codec/CodecTest.cpp:537: Failure Expected: nullptr Which is: 8-byte object <00-00 00-00 00-00 00-00> To be equal to: buf Which is: 8-byte object <08-50 82-00 00-00 00-00> [ FAILED ] LineBasedFrameDecoder.Fail (0 ms) [ RUN ] LineBasedFrameDecoder.NewLineOnly [ OK ] LineBasedFrameDecoder.NewLineOnly (0 ms) [ RUN ] LineBasedFrameDecoder.CarriageNewLineOnly [ OK ] LineBasedFrameDecoder.CarriageNewLineOnly (0 ms) [----------] 5 tests from LineBasedFrameDecoder (0 ms total)

[----------] Global test environment tear-down [==========] 18 tests from 5 test cases ran. (10 ms total) [ PASSED ] 17 tests. [ FAILED ] 1 test, listed below: [ FAILED ] LineBasedFrameDecoder.Fail

1 FAILED TEST

Test time = 0.08 sec ---------------------------------------------------------- Test Failed. "CodecTest" end time: Jun 12 10:08 CST "CodecTest" time elapsed: 00:00:00 ----------------------------------------------------------
yfeldblum commented 7 years ago

This is a known test failure in the oss build. It passes internally, so it is a bit awkward to debug.

msteinert commented 7 years ago

Thanks for the clarification.