PR: Reduce calls to get environment variables in SpyderKernelSpec and raise timeout threshold to do that#23278
Conversation
97ce9a7 to
6889041
Compare
b9c2b90 to
8d1c172
Compare
8d1c172 to
d186193
Compare
|
@ccordoba12, I think you mentioned using |
130519b to
d4cc4dc
Compare
|
#21769 introduced running the Now, specific to this PR, failing tests:
I don't believe there is any issue with moving |
d19c596 to
b00a956
Compare
|
The reason the tests were failing was due to checking the kernel cache, which compares all attributes of the
|
ccordoba12
left a comment
There was a problem hiding this comment.
A couple of small suggestions for you @mrclary, the rest looks good to me.
…an interactive shell that results in a SIGSTP.
Timeouts do not seem to be honored. ctrl-c still indicates test_dedicated_consoles is hanging at "with qtbot.waitSignal(shell.executed".
…ironment_variables once at instantiation, rather than every time SpyderKernelSpec.env is referenced. This should improve performance of starting new consoles since user_env.sh will not be executed as frequently. A setter is required in order to remove PYTEST_CURRENT_TEST from the meta property SpyderKernelSpec._env_vars, because CachedKernelMixin compares SpyderKernelSpec.__dict__ to validate cache.
…t is to guard against indefinite hangs; most users will never experience this limit.
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
c298136 to
15db321
Compare
ccordoba12
left a comment
There was a problem hiding this comment.
Looks good to me now, thanks @mrclary!
SpyderKernelSpec and raise timeout threshold to do that
|
@meeseeksdev please backport to 6.x |
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
SpyderKernelSpec and raise timeout threshold to do that SpyderKernelSpec and raise timeout threshold to do that
…iables in `SpyderKernelSpec` and raise timeout threshold to do that
… variables in SpyderKernelSpec and raise timeout threshold to do that) (#24001)
Description of Changes
I propose raising the timeout to 5s for all scenarios.
This PR raises the timeout for the subprocess for getting user environment variables from 0.5s to 5s, and reduces superfulous calls to
get_user_environment_variablesby moving it to the instantiation ofSpyderKernelSpecfromSpyderKernelSpec.env.I've run into a scenario where
get_user_environment_variablescan take up to ~1s or more. This triggers the timeout and renders the function useless, leaving users with incorrect environment variables sent to the console and language server.Currently,
get_user_environment_variablesis called inSpyderKernelSpec.env, which is not appropriate since this is decorated with@property.SpyderKernelSpec.envcan be referenced many times, resulting in superfluous exectution ofget_user_environment_variables(8 times during Spyder startup!).