• src/ssh/test/dssh_test.h mock_io.c mock_io.h test_alloc.c test_auth.c

    From Deucе@VERT to Git commit to main/sbbs/master on Thu Mar 26 15:33:15 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/d7e507b99612587aa9224954
    Modified Files:
    src/ssh/test/dssh_test.h mock_io.c mock_io.h test_alloc.c test_auth.c test_conn.c test_transport.c test_transport_errors.c
    Log Message:
    Fix 6 thread-timing issues in test infrastructure

    1. Double-close race: mock_io_pipe fds now _Atomic int; close
    helpers use atomic_exchange for exactly one close() per fd.
    2. Add mock_io_close_s2c_write() for symmetry with c2s_write.
    3. Crafted server threads in test_auth.c now close pipes on all
    error paths (prevents peer hangs on early failure).
    4. All 122 bare thrd_create() calls checked: new ASSERT_THRD_CREATE
    macro in dssh_test.h; helper functions use inline checks.
    5. mock_io_drain uses recv(MSG_DONTWAIT) instead of toggling
    O_NONBLOCK via fcntl (per-call, no fd-flag side effects).

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net