Skip to content

Commit ba657c9

Browse files
authored
[TECHDEBT] [P2P] Raintree test suite improvements: edge cases - Issue #279
Won't fix / outdated TODOes. Tracked in #179
1 parent cb8135a commit ba657c9

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

p2p/module_raintree_test.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import (
2828
"google.golang.org/protobuf/types/known/anypb"
2929
)
3030

31-
// IMPROVE(team): Looking into adding more tests and accounting for more edge cases.
32-
3331
// ### RainTree Unit Tests ###
3432

3533
func TestRainTreeCompleteOneNodes(t *testing.T) {
@@ -313,8 +311,6 @@ func prepareConsensusMock(t *testing.T, genesisState modules.GenesisState) *modu
313311
return consensusMock
314312
}
315313

316-
// TODO(team): make the test more rigorous but adding MaxTimes `EmitEvent` expectations. Since we are talking about more than one node
317-
// I have decided to do with `AnyTimes` for the moment.
318314
func prepareTelemetryMock(t *testing.T) *modulesMock.MockTelemetryModule {
319315
ctrl := gomock.NewController(t)
320316
telemetryMock := modulesMock.NewMockTelemetryModule(ctrl)
@@ -359,7 +355,7 @@ func prepareConnMock(t *testing.T, expectedNumNetworkReads, expectedNumNetworkWr
359355
connMock.EXPECT().Read().DoAndReturn(func() ([]byte, error) {
360356
data := <-testChannel
361357
return data, nil
362-
}).MaxTimes(int(expectedNumNetworkReads + 1)) // INVESTIGATE(olshansky): The +1 is necessary because there is one extra read of empty data by every channel...
358+
}).MaxTimes(int(expectedNumNetworkReads + 1))
363359

364360
connMock.EXPECT().Write(gomock.Any()).DoAndReturn(func(data []byte) error {
365361
testChannel <- data

p2p/raintree/peers_manager_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ type ExpectedRainTreeMessageProp struct {
3535
targets []ExpectedRainTreeMessageTarget
3636
}
3737

38-
// IMPROVE(team): Looking into adding more tests and accounting for more edge cases.
39-
4038
func TestRainTreeAddrBookUtilsHandleUpdate(t *testing.T) {
4139
addr, err := cryptoPocket.GenerateAddress()
4240
require.NoError(t, err)

0 commit comments

Comments
 (0)