mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossipd/test: fix flaky test.
The test is could actually go each way, since for 1000000 the fee is the same either way. Increase to 300000, and add an extra test when the alternate path is disabled. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
c8aa50a382
commit
ffaab09043
@ -108,11 +108,19 @@ int main(void)
|
||||
assert(fee == 0);
|
||||
|
||||
/* Will go via B for large amounts. */
|
||||
nc = find_route(ctx, rstate, &a, &c, 1000000, 1.0, &fee, &route);
|
||||
nc = find_route(ctx, rstate, &a, &c, 3000000, 1.0, &fee, &route);
|
||||
assert(nc);
|
||||
assert(tal_count(route) == 1);
|
||||
assert(pubkey_eq(&route[0]->src->id, &b));
|
||||
assert(fee == 2);
|
||||
assert(fee == 1 + 3);
|
||||
|
||||
/* Make B->C inactive, force it back via D */
|
||||
get_connection(rstate, &b, &c)->active = false;
|
||||
nc = find_route(ctx, rstate, &a, &c, 3000000, 1.0, &fee, &route);
|
||||
assert(nc);
|
||||
assert(tal_count(route) == 1);
|
||||
assert(pubkey_eq(&route[0]->src->id, &d));
|
||||
assert(fee == 0 + 6);
|
||||
|
||||
tal_free(ctx);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user