From ed3984f4446535002e18eb2086e42eb0273d5205 Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Sat, 10 Mar 2018 10:04:21 +0000 Subject: [PATCH] test_lightningd.py: Modify test_payment_duplicate_uncommitted. `pay` command will now wait for payment to succeed if the payment has been initiated. --- tests/test_lightningd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index c3fe1148d..af7329dcb 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -3332,14 +3332,15 @@ class LightningDTests(BaseLightningDTests): assert l1.rpc.listpayments()['payments'][0]['status'] == 'pending' assert l1.rpc.listpayments()['payments'][0]['payment_hash'] == inv1['payment_hash'] - # Second one should fail. - self.assertRaises(ValueError, l1.rpc.pay, inv1['bolt11']) + # Second one will succeed eventually. + fut2 = self.executor.submit(l1.rpc.pay, inv1['bolt11']) # Now, let it commit. l1.rpc.dev_reenable_commit(l2.info['id']) - # This should succeed. + # These should succeed. fut.result(10) + fut2.result(10) @unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1 for --dev-broadcast-interval") def test_gossip_badsig(self):