Tests: Try to remove old test sockets in TestLibCoreStream

If an error occurred during a previous test run, the file might be
lying around still. This should clear up CI failures happening on macOS
at the moment.
This commit is contained in:
Zaggy1024 2026-02-27 04:50:29 -06:00 committed by Gregory Bertilson
parent 8c96f7b3aa
commit 2d4a976616

View file

@ -343,6 +343,8 @@ TEST_CASE(local_socket_read)
Core::EventLoop event_loop;
auto socket_path = ByteString::formatted("{}/{}", Core::StandardPaths::tempfile_directory(), "test-socket"sv);
if (!Core::System::stat(socket_path).is_error())
TRY_OR_FAIL(Core::System::unlink(socket_path));
auto local_server = Core::LocalServer::construct();
EXPECT(local_server->listen(socket_path));
@ -391,6 +393,9 @@ TEST_CASE(local_socket_write)
Core::EventLoop event_loop;
auto socket_path = ByteString::formatted("{}/{}", Core::StandardPaths::tempfile_directory(), "test-socket"sv);
if (!Core::System::stat(socket_path).is_error())
TRY_OR_FAIL(Core::System::unlink(socket_path));
auto local_server = Core::LocalServer::construct();
EXPECT(local_server->listen(socket_path));