go-nitro icon indicating copy to clipboard operation
go-nitro copied to clipboard

Investigate hanging `CloseVirtual` calls

Open NiloCK opened this issue 2 years ago • 0 comments

In TestOutOfBandVoucher, a virtual channel is started, used to create vouchers, and closed.

Problem: the closure on line 97 never returns, and the test hangs indefinitely.

Solution: waiting for the objectiveComplete response on either client causes the test to continue running to completion. With inserts like

	close := bob.CloseVirtual(vAB.ChannelId)
	t.Logf("Waiting for close: %s", close)
	<-bob.ObjectiveCompleteChan(close)
	t.Fatalf("successful close")

or even

	close := bob.CloseVirtual(vAB.ChannelId)
	t.Logf("Waiting for close: %s", close)
	<-alice.ObjectiveCompleteChan(close)
	t.Fatalf("successful close")

the Fatalf is reached and fires. Commenting out the <-someclient.ObjectiveCompleteChan(close) line on either of these prevents the Fatalf from firing.

Problem: the solution doesn't make a lot of sense to me, either as something that should be expected to be done, or trying to reason about it after the fact.

NiloCK avatar Jun 23 '23 05:06 NiloCK