Skip to content

Conversation

@ivankulman
Copy link

@ivankulman ivankulman commented Jun 25, 2024

1126:
Timeout is a parameter in the request function, therefore the kwargs.get('timeout', self._timeout) would never get the specified value.

Also for consistency adding the timeout parser to default it to the class._timeout value if not provided.

1128:
Adding the return_async_id to the execute_process_with_return so that it has the same functionality and signature as the execute_with_return

linkages for github:
this fixes #1126 and adds #1128 as well.

@ivankulman
Copy link
Author

@MariusWirtz please review.

@ivankulman ivankulman changed the title Fixing #1126 - timeout is an explicit parameter hence kwargs(timeout) does not work Fixing #1126 and#1128 - timeout is an explicit parameter hence kwargs(timeout) does not work, adding request_async_id in execute_process_with_return Jun 25, 2024
Copy link
Collaborator

@MariusWirtz MariusWirtz left a comment

Choose a reason for hiding this comment

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

Looking good! Thanks for the fix.

It would be nice to have a test case to verify that

  • timeout works on unbound processes (should be easy to test with sleep ti function)
    - return_async_id indeed returns the async_id on processes and unbound processes

Currently, we don't have tests on either. That's probably how we missed the bug.

https://github.com/cubewise-code/tm1py/blob/master/Tests/ProcessService_test.py

@ivankulman
Copy link
Author

tests added

@ivankulman ivankulman requested a review from MariusWirtz June 27, 2024 05:26
Copy link
Collaborator

@MariusWirtz MariusWirtz left a comment

Choose a reason for hiding this comment

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

Nice work. Thank you!

@MariusWirtz MariusWirtz merged commit 041435e into cubewise-code:master Jun 27, 2024
@ivankulman
Copy link
Author

@MariusWirtz would you mind releasing this as 2.0.4? :)
We need these changes available in pypi for our internal repos.

@MariusWirtz
Copy link
Collaborator

I just found a minor issue.
When running all tests in the ProcessService_test class, the test_execute_process_with_return_returns_timeout fails.
Can you reproduce it?

image

As soon as this is resolved, I can do the 2.0.4 release

@ivankulman
Copy link
Author

Hi Marius,
Looks like the test case is using the pre-change version of the code and tries to JSONify the async id instead of just:
if return_async_id: return response

Just FYI, I am testing this against TM1 version: 11.8.02200.2

And here's my test output with successful tests:
image

@MariusWirtz
Copy link
Collaborator

Found it! #1130

Perhaps in your env, it wasn't reproducible because async_requests_mode is True in your config.ini?

I will merge and do a release.

@MariusWirtz
Copy link
Collaborator

MariusWirtz commented Jun 28, 2024

2.0.4 is available on pypi.
https://pypi.org/project/TM1py/2.0.4/

@ivankulman
Copy link
Author

Yes I had
async_requests_mode=True
In my config file.

Thanks for releasing to pypi!

Ivan

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.

Timeout setting not honoured for execute_process_with_return

3 participants