Skip to content

SEGFAULT in CI but works locally #563

Open
@Kishan-Ved

Description

@Kishan-Ved

Description of the problem

In the file: pydatastructs/trees/tests/test_binary_trees.py, inside the _test_SplayTree() function:
There are 2 code snippets which run only when the backend is Python. This is because if we run them in C++ backend, the CI checks fail. However, the code passes when run on my local machine (laptop - Ubuntu).

These are the code snippets:

    if(backend==Backend.PYTHON):
        trav3 = BinaryTreeTraversal(t, backend=backend)
        in_order = trav3.depth_first_search(order='in_order')
        pre_order = trav3.depth_first_search(order='pre_order')
        assert [node.key for node in in_order] == [20, 30, 50, 55, 100, 200, 1000, 2000]
        assert [node.key for node in pre_order] == [200, 55, 50, 30, 20, 100, 2000, 1000]
    if(backend==Backend.PYTHON):
        trav5 = BinaryTreeTraversal(t, backend=backend)
        in_order = trav5.depth_first_search(order='in_order')
        pre_order = trav5.depth_first_search(order='pre_order')
        assert [node.key for node in in_order] == [20, 30, 50, 55, 100, 200]
        assert [node.key for node in pre_order] == [200, 55, 50, 30, 20, 100]

This was added in PR: #562

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions