Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory leak detection during server process execution #357

Conversation

ochaplashkin
Copy link

@ochaplashkin ochaplashkin commented Mar 13, 2024

Memory leak detection may occur when working with the server:

g.test_foo = function()
    ...
    g.server:exec(function()
        -- there is an error from LeakSanitizer in `stderr` here
    end)
    g.server:exec(function()
        -- server is alive
   end)
   t.assert(true)
end)

g.after_all(function()
    g.server:drop() -- `test_foo` has passed
end)

We have added a check for the LeakSanitizer substring in stderr of the server process. If it's found, an error will be thrown and test will fail.

Closes #349

ℹ️ P.S. Although this PR solves the problem described in #349, there may be a more elegant solution to such detections. It is described in more detail in #358

@ochaplashkin ochaplashkin force-pushed the fix-memory-leak-detection-on-server-instance branch 5 times, most recently from 1de9aa7 to 9abeed6 Compare March 14, 2024 16:42
@ochaplashkin ochaplashkin marked this pull request as ready for review March 15, 2024 10:03
Memory leak detection may occur when working with the server:

    g.test_foo = function()
        ...
        g.server:exec(function()
            -- there is an error from LeakSanitizer in `stderr` here
        end)
        g.server:exec(function()
            -- server is alive
        end)
        t.assert(true)
    end)

    g.after_all(function()
        g.server:drop() -- `test_foo` has passed
    end)

We have added a check for the `LeakSanitizer` substring in `stderr` of
the server process. If it's found, an error will be thrown and test will
fail.

Closes tarantool#349
@ochaplashkin ochaplashkin force-pushed the fix-memory-leak-detection-on-server-instance branch from 9abeed6 to db20d97 Compare March 19, 2024 11:48
@ochaplashkin ochaplashkin changed the title Add check for any errors when the server stops Add memory leak detection during server process execution Mar 19, 2024
@ylobankov ylobankov merged commit e3ea6fc into tarantool:master Mar 19, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak is not checked for luatest.server instance
2 participants