-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace: occurrences of tests.utils.wait_until_signal with qtbot.wait_signal #2247
Conversation
@matrss so, I've created this PR to address and have attempted to modify the
While I've made changes from what i understood like the primary goal of the test in this change i did is to verify that the application handles user cancellation appropriately. i don't think i made the correct changes. Ik that their are some other changes that is required but i held off thinking i should make things clear before going further. could you guide me a bit. |
Lines 519 to 521 in b8a200d
Waiting for this signal to be emitted is used as an indicator that the retrieval that is associated with this progress dialog has finished. I.e. it is used in the query_server method to wait until all actions have been fully processed, essentially.
In the case of the method that you have already modified it would be this line that needs to be wrapped with the context manager: MSS/tests/_test_msui/test_sideview.py Line 152 in 2adcb27
(Maybe also the line before that one, but I don't think so, would need to see if tests pass or fail)
No, the query_server method in itself is not actually a test (you can see that because it doesn't start with The query_server method not being a test in itself also means that all call sites of this method (i.e. the actual tests) need to pass the qtbot fixture to it. |
i think the failure is because of Fixture Management can you take a look |
All of the test failures look like this:
What it means is that all tests that use query_server have to pass along the qtbot fixture that they receive. I.e. the calls to query_server have to be adapted as well, when its signature changes. Also, there are some minor linting issues from flake8, just click on "Details" of that check to see what they are. Other than that it is looking good already. Just a minor nitpick: I would like MSS/tests/_test_msui/test_mscolab.py Line 229 in d4e8d6b
|
@matrss the CI failed again can you take a look. this time is it because the missing |
Please look on the definition of the method query_server. I don't know which IDE you use. In pycharm I would do this by CTRL + click on the query_server word. you could also debug this, set a breakpoint and go into the line where it is defined. |
can you explain a bit i don't get it @ReimarBauer |
Yes, unfortunately the tests that require a running mscolab or mswms server can not be ran on windows at the moment. But the test suite runs in GitHub Actions for every PR, so you can see the test output there.
You have changed the signature of the query_server methods to include an additional parameter. Obviously all code that calls this method now needs to be adapted accordingly and pass in the correct arguments in the correct order. |
@matrss @ReimarBauer can you take a look does everything look good ? and i don't see
also i was thinking if removing it is not necessary right now. i could create a new issue out of it and this can be solved through a new PR. It could be a nice Good first issue for maybe newcomers. |
I don't think it is a good idea, when we already know the two steps to finish this issue. It may happen that we oversee sometimes something. But in this case it would mean we have to reopen the issue immeaditly because incomplete. We do this also with others when we recognize that it is not done. |
Please remove it.
As explained in the comment there this conditional skip can be removed as well, once wait_until_signal is gone.
I think it is within the scope for this PR to clean up the code that becomes obsolete due to the other changes. I don't want to have lingering dead code remain if it could be cleaned now as well. |
okey got it thankyou |
I saw several linting issues in the conf.py and some other files i am curious are there existing known issues or pull requests related to addressing these Flake8 warnings specifically in these files? this issues have been their since January i guess. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now. Thanks for the PR!
I assume you mean docs/conf.py, right? Currently we only lint the files under mslib/ and under tests/. There is no specific issue for this yet, but I would prefer if we would lint the entirety of the repository (modulo some auto-generated files). There is a somewhat related issue in #2145, where I wrote a bit about what I would like to have: #2145 (comment). This isn't high up on my list of priorities right now, though. |
Thanks for clarifying the context. |
Purpose of PR?: This issue concerns a potential race condition when using the
wait_until_signal
function for Qt testing. The function has a limitation where it only starts listening for a specific signal after the code that should emit that signal has been called. so, we'll Replace occurrences oftests.utils.wait_until_signal
withqtbot.wait_signal
. Becausewait_signal
is a context manager from pytest-qt that does not have this issue.Fixes #2156