MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_payment_speed

Function test_payment_speed

tests/benchmark.py:234–264  ·  view source on GitHub ↗

This makes sure we don't screw up nagle handling. Normally: Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations test_payment_speed 16.3587 40.4925 27.4874 5.5512 27.7885 8.9291 9;0 36.3803 33

(node_factory, benchmark)

Source from the content-addressed store, hash-verified

232
233
234def test_payment_speed(node_factory, benchmark):
235 """This makes sure we don't screw up nagle handling.
236
237 Normally:
238 Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
239 test_payment_speed 16.3587 40.4925 27.4874 5.5512 27.7885 8.9291 9;0 36.3803 33 1
240
241 Without TCP_NODELAY:
242 Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
243 test_payment_speed 153.7132 163.2027 158.6747 3.4059 158.5219 6.3745 3;0 6.3022 9 1
244 """
245 l1 = get_bench_node(node_factory, extra_options={'commit-time': 0})
246 l2 = get_bench_node(node_factory, extra_options={'commit-time': 0})
247
248 node_factory.join_nodes([l1, l2])
249
250 scid = only_one(l1.rpc.listpeerchannels()['channels'])['short_channel_id']
251 routestep = {
252 'amount_msat': 100,
253 'id': l2.info['id'],
254 'delay': 5,
255 'channel': scid
256 }
257
258 def onepay(l1, routestep):
259 phash = random.randbytes(32).hex()
260 l1.rpc.sendpay([routestep], phash)
261 with pytest.raises(RpcError, match="WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"):
262 l1.rpc.waitsendpay(phash)
263
264 benchmark(onepay, l1, routestep)
265
266
267def test_askrene_layers(node_factory):

Callers

nothing calls this directly

Calls 4

only_oneFunction · 0.90
get_bench_nodeFunction · 0.85
join_nodesMethod · 0.80
listpeerchannelsMethod · 0.80

Tested by

no test coverage detected