Skip to content

Commit 12b5555

Browse files
vitautfacebook-github-bot
authored andcommitted
Fix FdSocketTest on macOS
Summary: `FdSocketTest` fails when remotely executed on macOS because the path doesn't fit into the `sun_path` field of `sockaddr_un` when constructing a Unix domain socket. The size of this field is ~100 code units. Fix the test by making the path shorter. ``` $ buck test mode/mac-arm64 thrift/lib/cpp2/transport/rocket/server/test/... -- --run-disabled ✗ Fail: thrift/lib/cpp2/transport/rocket/server/test:FdSocketTest - BothInterceptedAndNot/FdWriteBatchingTest.Unbatched/0 (1.0s) Note: Google Test filter = BothInterceptedAndNot/FdWriteBatchingTest.BatchWithoutFDs/0:BothInterceptedAndNot/FdWriteBatchingTest.BatchWithoutFDs/1:BothInterceptedAndNot/FdWriteBatchingTest.FlushBatchDueToWriteCount /0:BothInterceptedAndNot/FdWriteBatchingTest.FlushBatchDueToWriteCount/1:BothInterceptedAndNot/FdWriteBatchingTest.Unbatched/0:BothInterceptedAndNot/FdWriteBatchingTest.Unbatched/1 [==========] Running 6 tests from 1 test suite. [----------] Global test environment set-up. [----------] 6 tests from BothInterceptedAndNot/FdWriteBatchingTest [ RUN ] BothInterceptedAndNot/FdWriteBatchingTest.Unbatched/0 libc++abi: terminating due to uncaught exception of type std::invalid_argument: socket path too large to fit into sockaddr_un *** Aborted at 1744052340 (Unix time, try 'date -d 1744052340') *** *** Signal 6 (SIGABRT) (0x186153720) received by PID 10862 (pthread TID 0x1efaf0840) (maybe from PID 10862, UID 30065) (code: 0), stack trace: *** 0 FdSocketTest 0x0000000104b8e288 _ZN5folly10symbolizer17getStackTraceSafeEPmm + 56 1 FdSocketTest 0x0000000104b76278 _ZN5folly10symbolizer21SafeStackTracePrinter15printStackTraceEb + 116 2 FdSocketTest 0x0000000104bccaa8 _ZN5folly10symbolizer12_GLOBAL__N_118innerSignalHandlerEiP9__siginfoPv + 268 3 FdSocketTest 0x0000000104bcc5f8 _ZN5folly10symbolizer12_GLOBAL__N_113signalHandlerEiP9__siginfoPv + 124 4 libsystem_platform.dylib 0x00000001861c2de4 _sigtramp + 56 5 libsystem_pthread.dylib 0x000000018618bf70 pthread_kill + 288 6 libsystem_c.dylib 0x0000000186098908 abort + 128 7 libc++abi.dylib 0x000000018614244c _ZN10__cxxabiv130__aligned_malloc_with_fallbackEm + 0 8 libc++abi.dylib 0x0000000186130a24 _ZL28demangling_terminate_handlerv + 320 9 libobjc.A.dylib 0x0000000185dd93f4 _ZL15_objc_terminatev + 172 10 libc++abi.dylib 0x0000000186141710 _ZSt11__terminatePFvvE + 16 11 libc++abi.dylib 0x0000000186144cdc __cxa_get_exception_ptr + 0 12 libc++abi.dylib 0x0000000186144c84 _ZN10__cxxabiv1L12failed_throwEPNS_15__cxa_exceptionE + 0 13 FdSocketTest 0x0000000105633004 _ZN5folly13SocketAddress11setFromPathENS_5RangeIPKcEE + 108 14 FdSocketTest 0x00000001049f5e54 _ZN19FdWriteBatchingTest4initEv + 1348 15 FdSocketTest 0x00000001049f5434 _ZN34FdWriteBatchingTest_Unbatched_Test8TestBodyEv + 316 16 FdSocketTest 0x0000000104ab406c _ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc + 560 17 FdSocketTest 0x0000000104ab3dec _ZN7testing4Test3RunEv + 192 18 FdSocketTest 0x0000000104ab4d88 _ZN7testing8TestInfo3RunEv + 316 19 FdSocketTest 0x0000000104ab5fd8 _ZN7testing9TestSuite3RunEv + 640 20 FdSocketTest 0x0000000104ac40b0 _ZN7testing8internal12UnitTestImpl11RunAllTestsEv + 1036 21 FdSocketTest 0x0000000104ac3c74 _ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS0_12UnitTestImplEbEET0_PT_MS4_FS3_vEPKc + 592 22 FdSocketTest 0x0000000104ac397c _ZN7testing8UnitTest3RunEv + 232 23 FdSocketTest 0x0000000104af7e2c _Z13RUN_ALL_TESTSv + 16 24 FdSocketTest 0x0000000104af7d50 main + 96 25 dyld 0x0000000185e0c274 start + 2840 ``` Reviewed By: iahs Differential Revision: D72586652 fbshipit-source-id: fe2e498de7ba47902fa9a93960f11ad58c32c136
1 parent 55a4acd commit 12b5555

File tree

1 file changed

+1
-1
lines changed
  • third-party/thrift/src/thrift/lib/cpp2/transport/rocket/server/test

1 file changed

+1
-1
lines changed

third-party/thrift/src/thrift/lib/cpp2/transport/rocket/server/test/FdSocketTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class FdWriteBatchingTest : public testing::TestWithParam<bool> {
159159
}
160160

161161
folly::SocketAddress sockAddr;
162-
sockAddr.setFromPath((tempDir_.path() / "fd-test-socket").string());
162+
sockAddr.setFromPath((tempDir_.path() / "sock").string());
163163

164164
runner_ = std::make_unique<ScopedServerInterfaceThread>(
165165
std::make_shared<ServerResponseEnqueuedInterface>(&sendQueue_, baton_),

0 commit comments

Comments
 (0)