-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add BEST_EFFORT in the controller switch tests. #582
Conversation
So... these tests are quite bulky. What I meant with the original comment of trying to parametrize them is to make it a little more compact. Can you think of a way to refactor this and the existing tests such that you can only pass in which mode you are testing, BEST_EFFORT or STRICT and some expectations on what should be the outcome? We are looking for something to reduce the code. |
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.
@Xi-HHHM this is very good first step! Thanks!
Along the comments from @bmagyar we should now try to make those test shorter. This concrete cases, where only one controller is “switched” has basically the same functionality for both cases, and therefore you could simply add a new function in the test file and call with different argument, i.e., STRICT
and BEST_EFFORT
.
I imagine the following tasks to do in this PR:
- Rename also another test to explicitly state that
STRICT
is used. - Add additional tests were multiple controllers are “switched” so that we can really test different behaviors between
STRICT
andBEST_EFFORT
. In short, the meaning of those by “switching” multiple controllers is:
STRICT
- is any of controllers can not be “switched”, none is “switched”BEST_EFFORT
- any controller that can be “switched” is “switched”
@bmagyar: Do you agree? Is this correct?
Yep, let me just take this out of draft mode so we can see the pipeline results. There is one thing I'd note: these interfaces are meant to have different behaviour for some cases, why are both happy with testing exactly the same assertions?
@Xi-HHHM what is your take on this? |
Only one controller is used and switch on and off in the test case. I think it was the reason why both test returned the same result. What we can do is that we add a "fake_controller", which is not defined and loaded, into the list of |
In this version, I added multiple controllers for testing and defined the expected behavior of I notice one thing though. As I tried to start a controller which has already been started, the test will crash(not fail). A hypothesis is that there is a resource conflict between the controllers. And then, I noticed that the test will crash as well, if we want to start a controller, and the a controller of the same type has already started. That is why I left the commented code |
I think there's nothing further to discuss! Can you please proceed with investigating whether the crash is the fault of the test or you've found a bug in controller_manager? |
@Xi-HHHM any updates on this? |
@bmagyar Sorry for replying late. I will go head and investigate what caused the crash. |
The CI is now passing... am I correct that somewhere within that |
Yes. The crashing part was commented out in that commit. Updates in the new commit:
|
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
@bmagyar @Xi-HHHM what do you think that we merge this now? @Xi-HHHM and I talked yesterday about further steps and that would be:
|
@bmagyar @Xi-HHHM what do you think that we merge this now? @Xi-HHHM and I talked yesterday about further steps and that would be:
|
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.
This is now fixing existing test. I would merge this and do the follow-up work in the new PR.
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.
agreed
Hi,
I am not sure if this PR meets the requirement of issue #521. A short review or feedback will be helpful.