Homework 3 forum

Possible error in gossiper_test.go::getOuts

 
Picture of Morten Borup Petersen
Possible error in gossiper_test.go::getOuts
by Morten Borup Petersen - Friday, 27 November 2020, 18:11
 

i think there might be an error in the getOuts function of gossiper_test.go:

The line:
> chanOut := n.gossiper.Watch(ctx, true)

will return the channel for incoming packets and not outgoing packets.
If we compare with the getIns function, the exact same channel (n.gossiper.Watch(ctx, true)) is requested.
My test pass if the channel is set to
> chanOut := n.gossiper.Watch(ctx, false)

- Morten

Picture of Stratos Triantafyllou
Re: Possible error in gossiper_test.go::getOuts
by Stratos Triantafyllou - Saturday, 28 November 2020, 14:21
 

I agree, it looks like a mistake. Note also the implementation of the `Watch` function, which points to `inWatcher` when it gets true as input, and `outWatcher` when false.

Picture of Pasindu Nivanthaka Tennage
Re: Possible error in gossiper_test.go::getOuts
by Pasindu Nivanthaka Tennage - Monday, 30 November 2020, 14:17
 

Thank you for the question.

Yes you are correct. chanOut should use false. We will correct this mistake and push the changes to student repos.

Regards
TAs