Skip to content

Commit a4d3a92

Browse files
committed
f make test run longer, i saw a failure locally
1 parent 7838d5d commit a4d3a92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning-invoice/src/payment.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,11 @@ mod tests {
517517
.unwrap()
518518
}
519519

520-
fn will_expire_in_1_sec_invoice(payment_preimage: PaymentPreimage) -> Invoice {
520+
fn will_expire_in_2_secs_invoice(payment_preimage: PaymentPreimage) -> Invoice {
521521
let payment_hash = Sha256::hash(&payment_preimage.0);
522522
let private_key = SecretKey::from_slice(&[42; 32]).unwrap();
523523
let timestamp = SystemTime::now()
524-
.checked_sub(Duration::from_secs(DEFAULT_EXPIRY_TIME - 1))
524+
.checked_sub(Duration::from_secs(DEFAULT_EXPIRY_TIME - 2))
525525
.unwrap();
526526
InvoiceBuilder::new(Currency::Bitcoin)
527527
.description("test".into())
@@ -769,9 +769,9 @@ mod tests {
769769
InvoicePayer::new(&payer, router, &scorer, &logger, event_handler, RetryAttempts(2));
770770

771771
let payment_preimage = PaymentPreimage([1; 32]);
772-
let invoice = will_expire_in_1_sec_invoice(payment_preimage);
772+
let invoice = will_expire_in_2_secs_invoice(payment_preimage);
773773
let payment_id = Some(invoice_payer.pay_invoice(&invoice).unwrap());
774-
std::thread::sleep(Duration::from_secs(2));
774+
std::thread::sleep(Duration::from_secs(4));
775775
assert_eq!(*payer.attempts.borrow(), 1);
776776

777777
let event = Event::PaymentPathFailed {

0 commit comments

Comments
 (0)