MSS icon indicating copy to clipboard operation
MSS copied to clipboard

fix: mscolab_chat, timeout tuple problem

Open levi178u opened this issue 8 months ago • 10 comments

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.

levi178u avatar Apr 09 '25 19:04 levi178u

Mentors plz review the PR

levi178u avatar Apr 09 '25 20:04 levi178u

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.

levi178u avatar Apr 10 '25 07:04 levi178u

I also wanna know what other changes should I do so that this timeout config. issue is resolved.

levi178u avatar Apr 10 '25 07:04 levi178u

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

ReimarBauer avatar Apr 10 '25 08:04 ReimarBauer

look on the changes url yourselft. What is irrelevant for the issue?

Bildschirmfoto 2025-04-10 um 10 49 45

ReimarBauer avatar Apr 10 '25 08:04 ReimarBauer

look on the changes url yourselft. What is irrelevant for the issue?

Bildschirmfoto 2025-04-10 um 10 49 45

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

image Here's the test log, once review this @ReimarBauer

levi178u avatar Apr 10 '25 09:04 levi178u

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.

levi178u avatar Apr 10 '25 09:04 levi178u

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

levi178u avatar Apr 11 '25 07:04 levi178u

#2716

The issue is not assigned to you. But when you want to work on it reproduce first by a test the issue description.

ReimarBauer avatar Apr 11 '25 10:04 ReimarBauer

#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

levi178u avatar Apr 11 '25 12:04 levi178u

solved by https://github.com/Open-MSS/MSS/pull/2815

ReimarBauer avatar Jun 23 '25 17:06 ReimarBauer