Conversation
|
Docs has the test runner as not thread safe so I am interested in what you find: These tools should only be used for testing since they change the entire interpreter state for simplicity. They are not thread-safe! |
|
Maybe #1572 is fixing the issue. |
|
I don't think you're doing this for performance, but I investigated pytest-xdist in a different context a couple of years ago, and at the time it was difficult to get a speedup because the startup time was linear to the number of workers. The startup time still seems to be linear to the number of workers, but the constant is much better now, here is a log with timing for As comparison, |
No, not in the results I got. I was under the impression that running tests in parallel would uncover the issues you were discussing in #3139 and #3140 with @getzze and @neutrinoceros. But it looks completely unrelated. Here the issues are with the pager: And the failing tests are completely random depending on the order they're executed (from 6 to 47 failing tests on my machine). That's why I was thinking that maybe a solution might be in the direction of #1572. So I guess you can continue working on #3139 and #3140 independently of this PR. |
Well, #3139 does contain a test that I took from one of the referenced tickets, and that test triggers Don't take my comment as discouragement from what you're trying to achieve here, I'm just stating that my goal with #3139 was the incredibly narrowly scoped "fix the immediate Click issue I'm suffering from". I would guess that not having multiple objects trying to close the same buffers in their finalizers would also be beneficial here, but I don't know the Click code base so take my guesses for what they are worth. |
sounds like a job for https://pypi.org/project/detect-test-pollution/ (just passing by, ignore me if that's not actually relevant) |
|
I'd prefer not adding these as a regular test, it introduces a lot of complexity and uncertainty. Maybe just use it to clean up tests here and then remove again. The tests already run very fast, and I'd prefer to speed them up directly if possible rather than by using multiprocessing. |
|
Oh that's definitely not a tool you want to run regularly in CI. It's really meant to help for local debugging only. Edit: hidden as off-topic, I thought David was talking about detect-test-pollution but on second thought that's probably not what he meant |
|
No that's fine, I was referring to all three plugins. |
2f81d8e to
c5b0fc6
Compare
|
So it turns out that these randomized tests did not helped in fixing any of these issues:
The issues above are fixed by #3139, and stress-tests helped in figuring things out. Not randomized tests as this PR was supposed to. |
|
Still! These randomized tests help uncovered an issue in another, completely different area from our initial investigation. So we have @davidism, given this new context, are you still against adding |
test_echo_via_pager
c5b0fc6 to
57ce42d
Compare
|
The problem is that whether it uncovers something or not is completely random so if we add this to CI unrelated PR might fail CI for no apparent reason to the author. If you want to add a specific tox environment for this fine, but it should not run by default locally or in CI. |
I'm fine with that policy. I will rework this PR in a couple of days then. |
test_echo_via_pager|
I moved the fix for the leaky test to its own PR at: #3238 That way we can benefits from it right away while I keep working on this PR. |
65282cd to
33d6cc1
Compare
Ok so I just added a new Now I would like to add some minimal documentation somewhere on how to run these tests. @Rowlando13 what's your opinion? Should we have a section somewhere in the Sphinx docs? I would like to document how to run the stress tests, the randomized tests, and the application smoke tests you implemented for Flask (#3177). So I can point contributors to them. Maybe not in |
0521fe0 to
e1f237e
Compare
|
You can add a new section for contributing. If it is standard stuff it should be added to pallets contributing. |
e1f237e to
a535f3f
Compare
Just documented the optional test suites at: https://github.com/pallets/click/pull/3151/changes#diff-419d79ae7d440d49b3fa5fa7739f5f3a359e3ca42c3fa942e5604ae3474eb35b |
Document optional test suites
cae594d to
692c645
Compare
This PR helps detection of leaks and flaky tests by running tests in randomized order and parallel.
Results:
Multiple cores are properly detected and tests are run in parallel:
Fix
test_echo_via_pagertest with was leaky and polluting others.