-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fixes for the brokers package #8
Conversation
Since we gracefully handle a cancellation call for IsAuthorized, we need to wait for the routine to return and close the done channel when CancelIsAuthorized is called, otherwise it just progresses the main routine without waiting for the expected values.
The previous calls for IsAuthorized and CancelIsAuthorized were using CallWithContext, which would associate the specified context with the calls. Since we rely on context cancelation to properly cancel the IsAuthorized operation on the Broker, we can't use the same context on the dbus call as it would result in the whole call being cancelled. Now they use Call instead, which uses context.Backgroung() by default.
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.
The changes look sensible to me, and I appreciate the splitting into separate, atomic commits 👍
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.
I think the rootDir usage is on purpose to avoid duplicating the path from the caller side in integration tests. It might be neeed to be reverted.
The rest of the changes looks good to me!
This allows us to use the examplebroker on the brokers package without having issues with import cycles.
In order to be able to continue using the examplebroker locally, some methods need to be public in order to be accessed in the brokers package
When moving examplebroker to a new package, the creation of those brokers got affected and they were being created with an empty interface that couldn't be used for tests. Now they are examplebrokers.
The function dbus.ConnectSystemBus() does exactly the same thing we were doing by using dbus.PrivateSystemBus() and then having to manually Auth and Hello, so it's better to use the ConnectSystemBus() one.
7c1e3e8
to
5f2740a
Compare
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! :)
When writing the tests, some problems emerged that demanded some fixing.
The details of each individual fix are contained in the commit messages.