multi: rename MakeTestGraphNew to MakeTestGraph
This commit is contained in:
7 files changed
+46
-46
No files matched your search
@@ -36,7 +36,7 @@ type testDBGraph struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newDiskChanGraph(t *testing.T) (testGraph, error) {
|
func newDiskChanGraph(t *testing.T) (testGraph, error) {
|
||||||
graphDB := graphdb.MakeTestGraphNew(t)
|
graphDB := graphdb.MakeTestGraph(t)
|
||||||
require.NoError(t, graphDB.Start())
|
require.NoError(t, graphDB.Start())
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
require.NoError(t, graphDB.Stop())
|
require.NoError(t, graphDB.Stop())
|
||||||
|
|||||||
@@ -1375,7 +1375,7 @@ func parseTestGraph(t *testing.T, useCache bool, path string) (
|
|||||||
testAddrs = append(testAddrs, testAddr)
|
testAddrs = append(testAddrs, testAddr)
|
||||||
|
|
||||||
// Next, create a temporary graph database for usage within the test.
|
// Next, create a temporary graph database for usage within the test.
|
||||||
graph := graphdb.MakeTestGraphNew(
|
graph := graphdb.MakeTestGraph(
|
||||||
t, graphdb.WithUseGraphCache(useCache),
|
t, graphdb.WithUseGraphCache(useCache),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1753,7 +1753,7 @@ func createTestGraphFromChannels(t *testing.T, useCache bool,
|
|||||||
testAddrs = append(testAddrs, testAddr)
|
testAddrs = append(testAddrs, testAddr)
|
||||||
|
|
||||||
// Next, create a temporary graph database for usage within the test.
|
// Next, create a temporary graph database for usage within the test.
|
||||||
graph := graphdb.MakeTestGraphNew(
|
graph := graphdb.MakeTestGraph(
|
||||||
t, graphdb.WithUseGraphCache(useCache),
|
t, graphdb.WithUseGraphCache(useCache),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -594,7 +594,7 @@ func (c *ChannelGraph) UpdateEdgePolicy(ctx context.Context,
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeTestGraphNew creates a new instance of the ChannelGraph for testing
|
// MakeTestGraph creates a new instance of the ChannelGraph for testing
|
||||||
// purposes. The backing V1Store implementation depends on the version of
|
// purposes. The backing V1Store implementation depends on the version of
|
||||||
// NewTestDB included in the current build.
|
// NewTestDB included in the current build.
|
||||||
//
|
//
|
||||||
@@ -603,7 +603,7 @@ func (c *ChannelGraph) UpdateEdgePolicy(ctx context.Context,
|
|||||||
// implemented, unit tests will be switched to use this function instead of
|
// implemented, unit tests will be switched to use this function instead of
|
||||||
// the existing MakeTestGraph helper. Once only this function is used, the
|
// the existing MakeTestGraph helper. Once only this function is used, the
|
||||||
// existing MakeTestGraph function will be removed and this one will be renamed.
|
// existing MakeTestGraph function will be removed and this one will be renamed.
|
||||||
func MakeTestGraphNew(t testing.TB,
|
func MakeTestGraph(t testing.TB,
|
||||||
opts ...ChanGraphOption) *ChannelGraph {
|
opts ...ChanGraphOption) *ChannelGraph {
|
||||||
|
|
||||||
t.Helper()
|
t.Helper()
|
||||||
|
|||||||
+38
-38
@@ -101,7 +101,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test basic insertion/deletion for vertexes from the
|
// We'd like to test basic insertion/deletion for vertexes from the
|
||||||
// graph, so we'll create a test vertex to start with.
|
// graph, so we'll create a test vertex to start with.
|
||||||
@@ -264,7 +264,7 @@ func TestPartialNode(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// To insert a partial node, we need to add a channel edge that has
|
// To insert a partial node, we need to add a channel edge that has
|
||||||
// node keys for nodes we are not yet aware
|
// node keys for nodes we are not yet aware
|
||||||
@@ -332,7 +332,7 @@ func TestAliasLookup(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test the alias index within the database, so first
|
// We'd like to test the alias index within the database, so first
|
||||||
// create a new test node.
|
// create a new test node.
|
||||||
@@ -363,7 +363,7 @@ func TestSourceNode(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test the setting/getting of the source node, so we
|
// We'd like to test the setting/getting of the source node, so we
|
||||||
// first create a fake node to use within the test.
|
// first create a fake node to use within the test.
|
||||||
@@ -390,7 +390,7 @@ func TestEdgeInsertionDeletion(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test the insertion/deletion of edges, so we create two
|
// We'd like to test the insertion/deletion of edges, so we create two
|
||||||
// vertexes to connect.
|
// vertexes to connect.
|
||||||
@@ -513,7 +513,7 @@ func TestDisconnectBlockAtHeight(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
sourceNode := createTestVertex(t)
|
sourceNode := createTestVertex(t)
|
||||||
if err := graph.SetSourceNode(ctx, sourceNode); err != nil {
|
if err := graph.SetSourceNode(ctx, sourceNode); err != nil {
|
||||||
@@ -810,7 +810,7 @@ func TestEdgeInfoUpdates(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test the update of edges inserted into the database, so
|
// We'd like to test the update of edges inserted into the database, so
|
||||||
// we create two vertexes to connect.
|
// we create two vertexes to connect.
|
||||||
@@ -1128,7 +1128,7 @@ func TestAddEdgeProof(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// Add an edge with no proof.
|
// Add an edge with no proof.
|
||||||
node1 := createTestVertex(t)
|
node1 := createTestVertex(t)
|
||||||
@@ -1187,7 +1187,7 @@ func TestForEachSourceNodeChannel(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// Create a source node (A) and set it as such in the DB.
|
// Create a source node (A) and set it as such in the DB.
|
||||||
nodeA := createTestVertex(t)
|
nodeA := createTestVertex(t)
|
||||||
@@ -1275,7 +1275,7 @@ func TestForEachSourceNodeChannel(t *testing.T) {
|
|||||||
func TestGraphTraversal(t *testing.T) {
|
func TestGraphTraversal(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test some of the graph traversal capabilities within
|
// We'd like to test some of the graph traversal capabilities within
|
||||||
// the DB, so we'll create a series of fake nodes to insert into the
|
// the DB, so we'll create a series of fake nodes to insert into the
|
||||||
@@ -1370,7 +1370,7 @@ func TestGraphTraversal(t *testing.T) {
|
|||||||
func TestGraphTraversalCacheable(t *testing.T) {
|
func TestGraphTraversalCacheable(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test some of the graph traversal capabilities within
|
// We'd like to test some of the graph traversal capabilities within
|
||||||
// the DB, so we'll create a series of fake nodes to insert into the
|
// the DB, so we'll create a series of fake nodes to insert into the
|
||||||
@@ -1440,7 +1440,7 @@ func TestGraphTraversalCacheable(t *testing.T) {
|
|||||||
func TestGraphCacheTraversal(t *testing.T) {
|
func TestGraphCacheTraversal(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test some of the graph traversal capabilities within
|
// We'd like to test some of the graph traversal capabilities within
|
||||||
// the DB, so we'll create a series of fake nodes to insert into the
|
// the DB, so we'll create a series of fake nodes to insert into the
|
||||||
@@ -1685,7 +1685,7 @@ func TestGraphPruning(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
sourceNode := createTestVertex(t)
|
sourceNode := createTestVertex(t)
|
||||||
if err := graph.SetSourceNode(ctx, sourceNode); err != nil {
|
if err := graph.SetSourceNode(ctx, sourceNode); err != nil {
|
||||||
@@ -1875,7 +1875,7 @@ func TestHighestChanID(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// If we don't yet have any channels in the database, then we should
|
// If we don't yet have any channels in the database, then we should
|
||||||
// get a channel ID of zero if we ask for the highest channel ID.
|
// get a channel ID of zero if we ask for the highest channel ID.
|
||||||
@@ -1935,7 +1935,7 @@ func TestChanUpdatesInHorizon(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// If we issue an arbitrary query before any channel updates are
|
// If we issue an arbitrary query before any channel updates are
|
||||||
// inserted in the database, we should get zero results.
|
// inserted in the database, we should get zero results.
|
||||||
@@ -2093,7 +2093,7 @@ func TestNodeUpdatesInHorizon(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
startTime := time.Unix(1234, 0)
|
startTime := time.Unix(1234, 0)
|
||||||
endTime := startTime
|
endTime := startTime
|
||||||
@@ -2196,7 +2196,7 @@ func TestNodeUpdatesInHorizon(t *testing.T) {
|
|||||||
func TestFilterKnownChanIDsZombieRevival(t *testing.T) {
|
func TestFilterKnownChanIDsZombieRevival(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
scid1 = lnwire.ShortChannelID{BlockHeight: 1}
|
scid1 = lnwire.ShortChannelID{BlockHeight: 1}
|
||||||
@@ -2262,7 +2262,7 @@ func TestFilterKnownChanIDs(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
isZombieUpdate := func(updateTime1 time.Time,
|
isZombieUpdate := func(updateTime1 time.Time,
|
||||||
updateTime2 time.Time) bool {
|
updateTime2 time.Time) bool {
|
||||||
@@ -2440,7 +2440,7 @@ func TestStressTestChannelGraphAPI(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
node1 := createTestVertex(t)
|
node1 := createTestVertex(t)
|
||||||
require.NoError(t, graph.AddLightningNode(ctx, node1))
|
require.NoError(t, graph.AddLightningNode(ctx, node1))
|
||||||
@@ -2729,7 +2729,7 @@ func TestFilterChannelRange(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'll first populate our graph with two nodes. All channels created
|
// We'll first populate our graph with two nodes. All channels created
|
||||||
// below will be made between these two nodes.
|
// below will be made between these two nodes.
|
||||||
@@ -2948,7 +2948,7 @@ func TestFetchChanInfos(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'll first populate our graph with two nodes. All channels created
|
// We'll first populate our graph with two nodes. All channels created
|
||||||
// below will be made between these two nodes.
|
// below will be made between these two nodes.
|
||||||
@@ -3051,7 +3051,7 @@ func TestIncompleteChannelPolicies(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// Create two nodes.
|
// Create two nodes.
|
||||||
node1 := createTestVertex(t)
|
node1 := createTestVertex(t)
|
||||||
@@ -3147,7 +3147,7 @@ func TestChannelEdgePruningUpdateIndexDeletion(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// The update index only applies to the bbolt graph.
|
// The update index only applies to the bbolt graph.
|
||||||
boltStore, ok := graph.V1Store.(*KVStore)
|
boltStore, ok := graph.V1Store.(*KVStore)
|
||||||
@@ -3295,7 +3295,7 @@ func TestPruneGraphNodes(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'll start off by inserting our source node, to ensure that it's
|
// We'll start off by inserting our source node, to ensure that it's
|
||||||
// the only node left after we prune the graph.
|
// the only node left after we prune the graph.
|
||||||
@@ -3361,7 +3361,7 @@ func TestAddChannelEdgeShellNodes(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// To start, we'll create two nodes, and only add one of them to the
|
// To start, we'll create two nodes, and only add one of them to the
|
||||||
// channel graph.
|
// channel graph.
|
||||||
@@ -3400,7 +3400,7 @@ func TestNodePruningUpdateIndexDeletion(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'll first populate our graph with a single node that will be
|
// We'll first populate our graph with a single node that will be
|
||||||
// removed shortly.
|
// removed shortly.
|
||||||
@@ -3469,19 +3469,19 @@ func TestNodeIsPublic(t *testing.T) {
|
|||||||
// We'll need to create a separate database and channel graph for each
|
// We'll need to create a separate database and channel graph for each
|
||||||
// participant to replicate real-world scenarios (private edges being in
|
// participant to replicate real-world scenarios (private edges being in
|
||||||
// some graphs but not others, etc.).
|
// some graphs but not others, etc.).
|
||||||
aliceGraph := MakeTestGraphNew(t)
|
aliceGraph := MakeTestGraph(t)
|
||||||
aliceNode := createTestVertex(t)
|
aliceNode := createTestVertex(t)
|
||||||
if err := aliceGraph.SetSourceNode(ctx, aliceNode); err != nil {
|
if err := aliceGraph.SetSourceNode(ctx, aliceNode); err != nil {
|
||||||
t.Fatalf("unable to set source node: %v", err)
|
t.Fatalf("unable to set source node: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
bobGraph := MakeTestGraphNew(t)
|
bobGraph := MakeTestGraph(t)
|
||||||
bobNode := createTestVertex(t)
|
bobNode := createTestVertex(t)
|
||||||
if err := bobGraph.SetSourceNode(ctx, bobNode); err != nil {
|
if err := bobGraph.SetSourceNode(ctx, bobNode); err != nil {
|
||||||
t.Fatalf("unable to set source node: %v", err)
|
t.Fatalf("unable to set source node: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
carolGraph := MakeTestGraphNew(t)
|
carolGraph := MakeTestGraph(t)
|
||||||
carolNode := createTestVertex(t)
|
carolNode := createTestVertex(t)
|
||||||
if err := carolGraph.SetSourceNode(ctx, carolNode); err != nil {
|
if err := carolGraph.SetSourceNode(ctx, carolNode); err != nil {
|
||||||
t.Fatalf("unable to set source node: %v", err)
|
t.Fatalf("unable to set source node: %v", err)
|
||||||
@@ -3596,7 +3596,7 @@ func TestDisabledChannelIDs(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// Create first node and add it to the graph.
|
// Create first node and add it to the graph.
|
||||||
node1 := createTestVertex(t)
|
node1 := createTestVertex(t)
|
||||||
@@ -3681,7 +3681,7 @@ func TestEdgePolicyMissingMaxHtcl(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// This test currently directly edits the bytes stored in the bbolt DB.
|
// This test currently directly edits the bytes stored in the bbolt DB.
|
||||||
boltStore, ok := graph.V1Store.(*KVStore)
|
boltStore, ok := graph.V1Store.(*KVStore)
|
||||||
@@ -3828,7 +3828,7 @@ func TestGraphZombieIndex(t *testing.T) {
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
// We'll start by creating our test graph along with a test edge.
|
// We'll start by creating our test graph along with a test edge.
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
node1 := createTestVertex(t)
|
node1 := createTestVertex(t)
|
||||||
node2 := createTestVertex(t)
|
node2 := createTestVertex(t)
|
||||||
@@ -4010,7 +4010,7 @@ func TestBatchedAddChannelEdge(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
sourceNode := createTestVertex(t)
|
sourceNode := createTestVertex(t)
|
||||||
require.Nil(t, graph.SetSourceNode(ctx, sourceNode))
|
require.Nil(t, graph.SetSourceNode(ctx, sourceNode))
|
||||||
@@ -4087,7 +4087,7 @@ func TestBatchedUpdateEdgePolicy(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// We'd like to test the update of edges inserted into the database, so
|
// We'd like to test the update of edges inserted into the database, so
|
||||||
// we create two vertexes to connect.
|
// we create two vertexes to connect.
|
||||||
@@ -4137,7 +4137,7 @@ func TestBatchedUpdateEdgePolicy(t *testing.T) {
|
|||||||
// BenchmarkForEachChannel is a benchmark test that measures the number of
|
// BenchmarkForEachChannel is a benchmark test that measures the number of
|
||||||
// allocations and the total memory consumed by the full graph traversal.
|
// allocations and the total memory consumed by the full graph traversal.
|
||||||
func BenchmarkForEachChannel(b *testing.B) {
|
func BenchmarkForEachChannel(b *testing.B) {
|
||||||
graph := MakeTestGraphNew(b)
|
graph := MakeTestGraph(b)
|
||||||
|
|
||||||
const numNodes = 100
|
const numNodes = 100
|
||||||
const numChannels = 4
|
const numChannels = 4
|
||||||
@@ -4190,7 +4190,7 @@ func TestGraphCacheForEachNodeChannel(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
// Unset the channel graph cache to simulate the user running with the
|
// Unset the channel graph cache to simulate the user running with the
|
||||||
// option turned off.
|
// option turned off.
|
||||||
@@ -4325,7 +4325,7 @@ func TestGraphLoading(t *testing.T) {
|
|||||||
func TestClosedScid(t *testing.T) {
|
func TestClosedScid(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
scid := lnwire.ShortChannelID{}
|
scid := lnwire.ShortChannelID{}
|
||||||
|
|
||||||
@@ -4362,7 +4362,7 @@ func TestLightningNodePersistence(t *testing.T) {
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
// Create a new test graph instance.
|
// Create a new test graph instance.
|
||||||
graph := MakeTestGraphNew(t)
|
graph := MakeTestGraph(t)
|
||||||
|
|
||||||
nodeAnnBytes, err := hex.DecodeString(testNodeAnn)
|
nodeAnnBytes, err := hex.DecodeString(testNodeAnn)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|||||||
@@ -1059,7 +1059,7 @@ type testCtx struct {
|
|||||||
func createTestCtxSingleNode(t *testing.T,
|
func createTestCtxSingleNode(t *testing.T,
|
||||||
startingHeight uint32) *testCtx {
|
startingHeight uint32) *testCtx {
|
||||||
|
|
||||||
graph := graphdb.MakeTestGraphNew(t)
|
graph := graphdb.MakeTestGraph(t)
|
||||||
sourceNode := createTestNode(t)
|
sourceNode := createTestNode(t)
|
||||||
|
|
||||||
require.NoError(t,
|
require.NoError(t,
|
||||||
|
|||||||
+1
-1
@@ -602,7 +602,7 @@ func createTestPeer(t *testing.T) *peerTestCtx {
|
|||||||
|
|
||||||
const chanActiveTimeout = time.Minute
|
const chanActiveTimeout = time.Minute
|
||||||
|
|
||||||
dbAliceGraph := graphdb.MakeTestGraphNew(t)
|
dbAliceGraph := graphdb.MakeTestGraph(t)
|
||||||
require.NoError(t, dbAliceGraph.Start())
|
require.NoError(t, dbAliceGraph.Start())
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
require.NoError(t, dbAliceGraph.Stop())
|
require.NoError(t, dbAliceGraph.Stop())
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ func makeTestGraph(t *testing.T, useCache bool) (*graphdb.ChannelGraph,
|
|||||||
kvdb.Backend, error) {
|
kvdb.Backend, error) {
|
||||||
|
|
||||||
// Create channelgraph for the first time.
|
// Create channelgraph for the first time.
|
||||||
graph := graphdb.MakeTestGraphNew(
|
graph := graphdb.MakeTestGraph(
|
||||||
t, graphdb.WithUseGraphCache(useCache),
|
t, graphdb.WithUseGraphCache(useCache),
|
||||||
)
|
)
|
||||||
require.NoError(t, graph.Start())
|
require.NoError(t, graph.Start())
|
||||||
|
|||||||
Reference in new issue
Block a user