Skip to content

Conversation

PProfizi
Copy link
Contributor

@PProfizi PProfizi commented Oct 3, 2025

No description provided.

@PProfizi PProfizi requested a review from cbellot000 October 3, 2025 13:01
@PProfizi PProfizi self-assigned this Oct 3, 2025
@PProfizi PProfizi added the enhancement New feature or request label Oct 3, 2025
@PProfizi PProfizi requested a review from rafacanton October 3, 2025 13:10
Copy link

codecov bot commented Oct 3, 2025

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
1773 5 1768 204
View the top 3 failed test(s) by shortest run time
test_server\test_server.py::test_server::TestServer::test_server_debug[None]
Stack Traces | 0.172s run time
self = <test_server.TestServer object at 0x000002337F3E4850>
server_config = None
tmp_path = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_None_2')

    def test_server_debug(self, server_config, tmp_path):
        from pathlib import Path
    
        server_instance = start_local_server(config=server_config)
        server_instance.start_debug(tmp_path / Path("DEBUG_TEST_"))
        f = dpf.core.field_from_array([1.0], server=server_instance)
        fwd = dpf.core.operators.utility.forward(any=f, server=server_instance)
        fwd.run()
        server_instance.stop_debug()
        debug_folder = sorted(tmp_path.glob("DEBUG_TEST_*"))
        assert len(debug_folder) == 1
        init_path = debug_folder[0] / Path("init.log")
>       assert init_path.exists()
E       AssertionError: assert False
E        +  where False = exists()
E        +    where exists = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_None_2/DEBUG_TEST_2025_10_07-08-38-37/init.log').exists

test_server\test_server.py:194: AssertionError
test_server\test_server.py::test_server::TestServer::test_server_debug[server_config5]
Stack Traces | 1.25s run time
self = <test_server.TestServer object at 0x0000019E3EDA5600>
server_config = <ansys.dpf.core.server_factory.ServerConfig object at 0x0000019E3CD4DFC0>
tmp_path = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi14')

    def test_server_debug(self, server_config, tmp_path):
        from pathlib import Path
    
        server_instance = start_local_server(config=server_config)
        server_instance.start_debug(tmp_path / Path("DEBUG_TEST_"))
        f = dpf.core.field_from_array([1.0], server=server_instance)
        fwd = dpf.core.operators.utility.forward(any=f, server=server_instance)
        fwd.run()
        server_instance.stop_debug()
        debug_folder = sorted(tmp_path.glob("DEBUG_TEST_*"))
        assert len(debug_folder) == 1
        init_path = debug_folder[0] / Path("init.log")
>       assert init_path.exists()
E       AssertionError: assert False
E        +  where False = exists()
E        +    where exists = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi14/DEBUG_TEST_2025_10_07-08-59-52/init.log').exists

test_server\test_server.py:194: AssertionError
test_server\test_server.py::test_server::TestServer::test_server_debug[server_config4]
Stack Traces | 1.33s run time
self = <test_server.TestServer object at 0x0000019E3EDA5540>
server_config = <ansys.dpf.core.server_factory.ServerConfig object at 0x0000019E3CD4DF60>
tmp_path = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi11')

    def test_server_debug(self, server_config, tmp_path):
        from pathlib import Path
    
        server_instance = start_local_server(config=server_config)
        server_instance.start_debug(tmp_path / Path("DEBUG_TEST_"))
        f = dpf.core.field_from_array([1.0], server=server_instance)
        fwd = dpf.core.operators.utility.forward(any=f, server=server_instance)
        fwd.run()
        server_instance.stop_debug()
        debug_folder = sorted(tmp_path.glob("DEBUG_TEST_*"))
        assert len(debug_folder) == 1
        init_path = debug_folder[0] / Path("init.log")
>       assert init_path.exists()
E       AssertionError: assert False
E        +  where False = exists()
E        +    where exists = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi11/DEBUG_TEST_2025_10_07-08-59-48/init.log').exists

test_server\test_server.py:194: AssertionError
test_server\test_server.py::test_server::TestServer::test_server_debug[server_config1]
Stack Traces | 1.34s run time
self = <test_server.TestServer object at 0x0000019E3EDA50C0>
server_config = <ansys.dpf.core.server_factory.ServerConfig object at 0x0000019E3CD4D300>
tmp_path = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi2')

    def test_server_debug(self, server_config, tmp_path):
        from pathlib import Path
    
        server_instance = start_local_server(config=server_config)
        server_instance.start_debug(tmp_path / Path("DEBUG_TEST_"))
        f = dpf.core.field_from_array([1.0], server=server_instance)
        fwd = dpf.core.operators.utility.forward(any=f, server=server_instance)
        fwd.run()
        server_instance.stop_debug()
        debug_folder = sorted(tmp_path.glob("DEBUG_TEST_*"))
        assert len(debug_folder) == 1
        init_path = debug_folder[0] / Path("init.log")
>       assert init_path.exists()
E       AssertionError: assert False
E        +  where False = exists()
E        +    where exists = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi2/DEBUG_TEST_2025_10_07-08-59-08/init.log').exists

test_server\test_server.py:194: AssertionError
test_server\test_server.py::test_server::TestServer::test_server_debug[server_config3]
Stack Traces | 16.4s run time
self = <test_server.TestServer object at 0x0000019E3EDA5480>
server_config = <ansys.dpf.core.server_factory.ServerConfig object at 0x0000019E3CD4DF00>
tmp_path = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi8')

    def test_server_debug(self, server_config, tmp_path):
        from pathlib import Path
    
        server_instance = start_local_server(config=server_config)
        server_instance.start_debug(tmp_path / Path("DEBUG_TEST_"))
        f = dpf.core.field_from_array([1.0], server=server_instance)
        fwd = dpf.core.operators.utility.forward(any=f, server=server_instance)
        fwd.run()
        server_instance.stop_debug()
        debug_folder = sorted(tmp_path.glob("DEBUG_TEST_*"))
        assert len(debug_folder) == 1
        init_path = debug_folder[0] / Path("init.log")
>       assert init_path.exists()
E       AssertionError: assert False
E        +  where False = exists()
E        +    where exists = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi8/DEBUG_TEST_2025_10_07-08-59-45/init.log').exists

test_server\test_server.py:194: AssertionError
test_server\test_server.py::test_server::TestServer::test_server_debug[server_config2]
Stack Traces | 16.8s run time
self = <test_server.TestServer object at 0x0000019E3EDA53C0>
server_config = <ansys.dpf.core.server_factory.ServerConfig object at 0x0000019E3CD4DEA0>
tmp_path = WindowsPath('D:.../pydpf-core/pydpf-core/.tox.../pytest-of-unknown/pytest-0/test_server_debug_server_confi5')

    def test_server_debug(self, server_config, tmp_path):
        from pathlib import Path
    
        server_instance = start_local_server(config=server_config)
>       server_instance.start_debug(tmp_path / Path("DEBUG_TEST_"))

test_server\test_server.py:186: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\test-server\lib\site-packages\ansys\dpf\core\server_types.py:730: in start_debug
    api.data_processing_set_debug_trace(text=str(folder_path))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

text = 'D:\\a\\pydpf-core\\pydpf-core\\.tox\\test-server\\tmp\\pytest-of-unknown\\pytest-0\\test_server_debug_server_confi5\\DEBUG_TEST_'

    @staticmethod
    def data_processing_set_debug_trace(text):
>   	raise NotImplementedError
E    NotImplementedError

.tox\test-server\lib\site-packages\ansys\dpf\gate\generated\data_processing_abstract_api.py:40: NotImplementedError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

except:
warnings.warn(traceback.format_exc())

def start_debug(self, folder_path: str | Path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it really be at the server API? Wouldn't it be better in core, close to load plugin...

Also, I would create a context manager (similar design to licensing context manager)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I'll put tests but I wanted to validate the API first

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put it at the Server level because it is a specific server you ask for its debug info.
I can make a context manager and also expose it at the ansys.dpf.core level as a global command which would take the global server.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense here, as it is for a given server.

Just a question, I remember we had an issue in the past that was fixed for data sources when the client was in a OS (say Windows) and the server was another (say Linux), that there was some path adaptation. I think that was fixed. Is this affected by that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense here, as it is for a given server.

Just a question, I remember we had an issue in the past that was fixed for data sources when the client was in a OS (say Windows) and the server was another (say Linux), that there was some path adaptation. I think that was fixed. Is this affected by that?

yes you are right, I am now adding the same logic here.

@PProfizi
Copy link
Contributor Author

PProfizi commented Oct 7, 2025

@cbellot000 @rafacanton while testing I found a weird behavior:

The test starts a server, sets a folder for the debug trace, then runs a forward operator.
The DEBUG_TEST_*** folder is correctly created for each test configuration, but only the first has a init.log file, with the traces for all 5 runs appended to the same file.

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Some tests with 'continue-on-error: true' have failed:

from pathlib import Path

server_instance = start_local_server(config=server_config)
server_instance.start_debug(tmp_path / Path("DEBUG_TEST_"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You miss a "/" or "" at the end

@rafacanton
Copy link
Contributor

@cbellot000 @rafacanton while testing I found a weird behavior:

The test starts a server, sets a folder for the debug trace, then runs a forward operator. The DEBUG_TEST_*** folder is correctly created for each test configuration, but only the first has a init.log file, with the traces for all 5 runs appended to the same file.

@PProfizi The rule is that each new DPF server and thread has its own init.log file. Can you add the "" or "/"? In that case, each DPF server should write a new temp subffolder under the "DEBUG_TEST_" folder and you should see different init files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants