fix: mscolab_chat, timeout tuple problem
fixes: #2716
What are the changes ?
- Updated default config to provide timeout as a tuple instead of a list.
- Modified validation logic to expect tuples for timeout.
- Enhanced merge_dict() to convert user-provided lists to tuples during merge.
- Ensured compatibility with requests.get() by enforcing correct format at config level.
Mentors plz review the PR
please look on what you pushed.
which changes are related to the issue?
Could you also add a unit test which shows the problem happening and that your suggestion does fix it.
Basically the requests.get() funct is getting ([2, 10], [2, 10]) but it expects it to be ([2,10]) i.e (connect_timeout, read_timeout). So in the config.py I just made sure the above is done and I tested it via _test_utils 's test_config pytest , where all cases passed and pytest.log was auto-generated.
I also wanna know what other changes should I do so that this timeout config. issue is resolved.
the idea for getting knowledge if it is complete is to write first a test which shows the problem. Then provide the fix, which does not anymore have a failing test
look on the changes url yourselft. What is irrelevant for the issue?
look on the changes url yourselft. What is irrelevant for the issue?
Yes in the changes section the "MSCOLAB_timeout": ([2, 10]) and MSCOLAB_timeout = (2, 10) is only relevent as I'm solving the tuple issue and i had done changes in the config.py under utils, also i added fs in pixi.toml coz I ran the pytest for this using this:
pixi install
pixi run -e dev pytest tests/_test_utils
Here's the test log, once review this @ReimarBauer
I also wanna know what other changes should I do so that this timeout config. issue is resolved.
Ok I got it, I'll write some test cases against the changes,sure.
Ok @ReimarBauer I have prepared a test case file covering more cases and edge cases too, can I push it for review. Also I have asked few doubts in slack thread, do check them. Cases such as negative nums, other ds besides tuple, empty ds, float nums, int nums, etc.. i have added cases considering them too
#2716
The issue is not assigned to you. But when you want to work on it reproduce first by a test the issue description.
#2716
The issue is not assigned to you. But when you want to work on it reproduce first by a test the issue description.
Ok , here I have added the test file (test_mscolab_timeout.py) , pls review the same, also what changes should I do in the test file pls suggest
solved by https://github.com/Open-MSS/MSS/pull/2815
