As highlighted when working on #11397, it is impossible to implement good unit tests for pkg/hubble/relay without refactoring the Server code.
There are notably these major issues that need to be addressed:
- The peers syncing logic is tightly coupled to the relay server. This should be extracted and turned into something that can easily be mocked for tests.
- Given options are used to start gRPC clients for both the peer service and the observer service. This should be changed such that a client interface can be used and mocks implemented.
As highlighted when working on #11397, it is impossible to implement good unit tests for
pkg/hubble/relaywithout refactoring theServercode.There are notably these major issues that need to be addressed: