-
Notifications
You must be signed in to change notification settings - Fork 16
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
Some updates to brokers & testutils packages #26
Conversation
We used to have a single layout validator for the broker, but this would create race issues when dealing with multiple calls at the same time, so this commit changes it to be one validator per sessionID.
This was preventing us from being able to run a general broker for the tests. Also updates newBrokerForTests function with the mock changes.
@didrocks, I think the tests we were thinking about (having multiple brokers and checking if the right one is answering the calls) make more sense in the PAM tests, as we operate directly on the broker object in the broker tests... (And in the manager tests they kind of already work, because [technically] the manager always has at least two brokers). |
I disagree, I think they should be in the broker tests because you want to proove that the brokers package is safe when used against multiple brokers. Then, nothing prevent in the PAM tests or rather integration tests, to exercise multiple brokers too. |
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.
Excellent! Feel free to add the 2 other tests in a separate PR.
There is only one small thing to align between the 3 tests, see my comments, then, we should be good to merge that one.
2c52e97
to
18bacde
Compare
In order to be a bit more consistent with the PAM module, we changed some namings from "value" to "entry". Also updated the calls to newBrokerForTests in the tests, since the function signature got changed.
Now the sessionID can have some values appended to it in order to allow us to use a single broker during parallel tests without having the same sessionID to deal with.
This test had some unused variables and its behaviour was a bit strange to understand. This commit reworks it to be more straightforward and also print the golden files even in error cases.
9d15890
to
fa0959f
Compare
When writing the PAM service tests, some changes had to be made to improve consistency and naming across the board. Also, since we intended to run a single broker for the PAM tests, we also had to update the mock creation to stop relying on testing.T.
This PR is mainly an extraction of the changes in the brokers that were made in #22.