From 916059da483371d8e93c4961743f3c23f1a703f7 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 23 Mar 2021 16:58:55 -0700 Subject: [PATCH] routing: update chan pruning test w/ new zombie logic --- routing/router_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/routing/router_test.go b/routing/router_test.go index a7c082e9..ff990350 100644 --- a/routing/router_test.go +++ b/routing/router_test.go @@ -1946,8 +1946,8 @@ func TestPruneChannelGraphStaleEdges(t *testing.T) { freshTimestamp := time.Now() staleTimestamp := time.Unix(0, 0) - // We'll create the following test graph so that only the last channel - // is pruned. + // We'll create the following test graph so that two of the channels + // are pruned. testChannels := []*testChannel{ // No edges. { @@ -2037,8 +2037,10 @@ func TestPruneChannelGraphStaleEdges(t *testing.T) { t.Fatalf("unable to prune zombie channels: %v", err) } - prunedChannel := testChannels[len(testChannels)-1].ChannelID - assertChannelsPruned(t, ctx.graph, testChannels, prunedChannel) + // We expect channels that have either both edges stale, or one edge + // stale with both known. + prunedChannels := []uint64{4, 6} + assertChannelsPruned(t, ctx.graph, testChannels, prunedChannels...) } // TestPruneChannelGraphDoubleDisabled test that we can properly prune channels