Skip to content

macOS: make tests stable and portable #12559

@mandesero

Description

@mandesero

While running the test suite on macOS, I encountered several tests that either consistently fail or flaky. This indicates that some tests rely on platform-specific assumptions or are not fully stable across environments.

It would be great to improve test stability and make them platform-independent where possible.

Environment:

Tarantool 3.7.0-entrypoint-218-g4e6123983f
Target: Darwin-arm64-Debug
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=TRUE
Compiler: AppleClang-17.0.0.17000013
C_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=<...>=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -Wno-cast-function-type -Werror -g -ggdb -O0
CXX_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=<...>=. -std=c++17 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type -Werror -g -ggdb -O0

System & Hardware
$ sw_vers
ProductName:		macOS
ProductVersion:		15.6.1
BuildVersion:		24G90

$ sysctl -n machdep.cpu.brand_string
Apple M4 Pro

List of problematic tests

Note: the list below is not exhaustive — it only includes the issues I was able to identify so far.

Fails

  • app/socket.test.lua test: make SO_REUSEPORT socket test portable #12561
    SO_REUSEPORT value differs from Linux: getsockopt() may return 512 instead of 1

  • metrics-luatest/tarantool_memory_metrics_test.lua test: make memory metrics test portable metrics#542
    tnt_memory_virt is expected to be positive, but is 0 on non-Linux platforms

  • app-luatest/popen_test.lua test: make popen is_closed check portable #12562
    popen.shell(...):close() may return nil, err even though the handle is already closed

  • box-luatest/gh_11803_interface_option_test.lua test: make interface option test portable #12563
    test assumes loopback interface name is lo, while macOS uses lo0

  • box-luatest/iproto_export_test.lua test: skip app threads tests on macOS #12586
    server crashes during startup in application threads. Lua module resolution is broken (http.client.lib is attempted to be loaded from /, leading to cannot read /: Is a directory)

    server.log
    server | 2026-04-18 19:34:16.534 [88422] app1 init.c:618 C> builtin/http.client.lua:32: error loading module 'http.client.lib' from file '/':
    server |     cannot read /: Is a directory
    server | 2026-04-18 19:34:16.534 [88422] app1 init.c:626 C> #2 (null) (), builtin/internal.loaders.lua:245
    server | 2026-04-18 19:34:16.534 [88422] app1 init.c:626 C> #3 require (global), [C]:-1
    server | 2026-04-18 19:34:16.534 [88422] app1 init.c:626 C> #4 (null) (), builtin/http.client.lua:32
    
  • box-luatest/app_threads_test.lua test: skip app threads tests on macOS #12586
    application threads fail to load standard Lua modules (e.g. metrics.tarantool).

    server.log
    server | 2026-04-18 19:34:15.896 [88396] app2 say.c:88 F> Error loading Lua module metrics.tarantool...: (null)
    
  • box-luatest/app_threads_module_test.lua test: skip app threads tests on macOS #12586
    same issue as in box-luatest/app_threads_test.lua

  • config-luatest/roles_test.lua — fixed by box: log the signals handled by libev #12543
    Shutdown log is matched too strictly: test expects line ending at Terminated,
    but macOS may add a suffix (e.g. Terminated: 15).

  • replication-luatest/gh_10506_spam_in_netbox_logs_test.lua test: make net.box spam log test portable #12569
    The test uses localhost:0 as a stand-in for a refused connection, but on macOS that address may produce a different socket error instead of Connection refused (Can't assign requested address).

Flaky / may hang

  • box-luatest/session_test.luaflaky under parallel runs test: isolate interactive console workdir #12565
    box.cfg({}) in an interactive child may fail with ALREADY_RUNNING: Failed to lock WAL directory .

  • app-luatest/http_client_http_version_test.lua test: make http client version test stable #12587
    intermittent Could not connect to server before reaching the HTTP/ALPN assertion

  • app/fio.test.luaflaky under parallel runs test: make fio tempdir test stable #12594
    The gh-4794 section uses a fixed directory name under cwd as a custom TMPDIR. Under repeated runs, may fails with fio: File exists

  • metrics-luatest/tarantool_config_metrics_test.luaflaky under parallel runs
    Fixed port (localhost:3301) causes conflicts; metrics are read too early after config:reload().

  • replication-py/cluster.test.py
    Reuses iproto connection after failed SUBSCRIBE, which may leave it broken => Connection reset by peer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions