Skip to content

Fix test after addition of Rotation result #2542

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ricardopeixotocoelho
Copy link
Contributor

@ricardopeixotocoelho ricardopeixotocoelho commented Aug 8, 2025

After the addition of rotation result to available results, the position of ENF result got shifted from 3rd position to 4th for the test:02-hdf5_serialize_and_read. This made the comparison happen on a different result which caused an error.

This PR changes the test so that we always look at the result ENF no matter its position on the result info.

@ricardopeixotocoelho ricardopeixotocoelho force-pushed the rpeixoto/fix_test_after_addition_rot branch from 6e655db to b46e847 Compare August 8, 2025 13:14
Copy link

codecov bot commented Aug 8, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
28595 1 28594 3905
View the top 1 failed test(s) by shortest run time
test_entry.py::test_apply_context_remote[gRPC CLayer]
Stack Traces | 23.6s run time
remote_config_server_type = <ansys.dpf.core.server_factory.ServerConfig object at 0x000002B769AAF9D0>

    @pytest.mark.order(4)
    @pytest.mark.skipif(
        not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0, reason="not supported"
    )
    @conftest.raises_for_servers_version_under("6.0")
    def test_apply_context_remote(remote_config_server_type):
        dpf.server.shutdown_all_session_servers()
        dpf.SERVER_CONFIGURATION = remote_config_server_type
        field = dpf.Field()
        field.append([0.0], 1)
        if conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_0:
            if conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_1:
                with pytest.raises(errors.DPFServerException):
                    op = dpf.Operator("core::field::high_pass")
                    op.connect(0, field)
                    op.connect(1, 0.0)
                    op.eval()
            else:
                with pytest.raises(errors.DPFServerException):
                    _ = dpf.Operator("core::field::high_pass")
                with pytest.raises(errors.DPFServerException):
                    if dpf.SERVER.os == "nt":
                        dpf.load_library("Ans.Dpf.Math.dll", "math_operators")
                    else:
                        dpf.load_library("libAns.Dpf.Math.so", "math_operators")
            assert dpf.SERVER.context == dpf.AvailableServerContexts.entry
        else:
            dpf.start_local_server()
    
        dpf.SERVER.apply_context(dpf.AvailableServerContexts.premium)
        op = dpf.Operator("core::field::high_pass")
        op.connect(0, field)
        op.connect(1, 0.0)
        op.eval()
        field = None
        assert dpf.SERVER.context == dpf.AvailableServerContexts.premium
        dpf.server.shutdown_all_session_servers()
>       field = dpf.Field()

tests\entry\test_entry.py:121: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\field.py:214: in __init__
    super().__init__(
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\field_base.py:53: in __init__
    self._server = server_module.get_or_create_server(
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\server.py:415: in get_or_create_server
    return _global_server()
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\server.py:100: in _global_server
    start_local_server(as_global=True)
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\server.py:257: in start_local_server
    server = server_type(
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\server_types.py:852: in __init__
    self._check_first_call(timeout=timeout - (time.time() - start_time))  # Pass remaining time
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\server_types.py:871: in _check_first_call
    raise e
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\server_types.py:865: in _check_first_call
    _ = self.version
.tox\test-api_entry\lib\site-packages\ansys\dpf\core\server_types.py:888: in version
    api.data_processing_get_server_version_on_client(self.client, major, minor)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

client = <ansys.dpf.core.server_types.GrpcClient object at 0x000002B76D541030>
major = <ansys.dpf.gate.integral_types.MutableInt32 object at 0x000002B76D540E50>
minor = <ansys.dpf.gate.integral_types.MutableInt32 object at 0x000002B76D540E80>

    @staticmethod
    def data_processing_get_server_version_on_client(client, major, minor):
    	errorSize = ctypes.c_int(0)
    	sError = ctypes.c_wchar_p()
    	res = capi.dll.DataProcessing_getServerVersion_on_client(client._internal_obj if client is not None else None, ctypes.byref(utils.to_int32(major)), ctypes.byref(utils.to_int32(minor)), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
    	if errorSize.value != 0:
>   		raise errors.DPFServerException(sError.value)
E     ansys.dpf.gate.errors.DPFServerException: a 'cancelled' error occurred: CANCELLED

.tox\test-api_entry\lib\site-packages\ansys\dpf\gate\generated\data_processing_capi.py:498: DPFServerException

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

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.

1 participant