Consider adding support for detecting leaked tempfiles / fds in the test harness · Issue #4066 · libgit2/libgit2 · GitHub
Skip to content

Consider adding support for detecting leaked tempfiles / fds in the test harness #4066

Description

@lhchavez

While writing #4060 I realized there are some operations that can lead to stray temporary files / leaked fds. I wrote a test for the particular scenario, but it might be better to modify the test code to always check for leaked fds and add a bunch of tests that just create / destroy objects. I already manually verified that today after running the whole test suite, there are no leaks, so there is no immediate cause for concern.

Reproduction steps

git_indexer *idx;
git_indexer_new(&idx, ".", 0, NULL, NULL, NULL));
git_indexer_free(idx);

Expected behavior

There are no temporary files in the filesystem.

Actual behavior

There is one leaked fd and one temporary file left in the filesystem.

Version of libgit2 (release number or SHA1)

75db289

Operating system(s) tested

Linux (and Windows https://ci.appveyor.com/project/libgit2/libgit2/build/3023 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions