Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR serves to fix the #395 issue of failing unit tests.
App Randomizer Internal Test
Location:
channel/test/app_randomizer_internal_test.go
Cause: The issue stems from the lack of Comparator (
Equal
) for MockAppRandomizer. This leads to the test not recognizing that the default appRandomizer has already been set in the internal test.Solution: Add an identifier to the MockAppRandomizer to compare the old and new appRandomizer.
Dialer Internal Test
Location: (
wire/net/simple/dialer_internal_test.go
)Cause: Like @RmbRT has pointed out, there is a race between the init of
wire/simple
andbackend/sim/wire
, which set the RandomAddress and RandomAccount functions to be used in the internal tests.Solution: Add the initialization of
NewRandomAddress
andNewRandomAccount
to use the implementation from thewire/simple
.Alternative: Remove
init()
ofwire/simple
and only use the init ofbackend/sim/wire
. This also results in passing internal tests but might cause issues for packages usingwire/simple
(need further investigation).