Skip to content

Commit a4e15f3

Browse files
committed
f make test run longer, i saw a failure locally
1 parent 204102f commit a4e15f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning-invoice/src/payment.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,11 @@ mod tests {
518518
.unwrap()
519519
}
520520

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

772772
let payment_preimage = PaymentPreimage([1; 32]);
773-
let invoice = will_expire_in_1_sec_invoice(payment_preimage);
773+
let invoice = will_expire_in_2_secs_invoice(payment_preimage);
774774
let payment_id = Some(invoice_payer.pay_invoice(&invoice).unwrap());
775-
std::thread::sleep(Duration::from_secs(2));
775+
std::thread::sleep(Duration::from_secs(4));
776776
assert_eq!(*payer.attempts.borrow(), 1);
777777

778778
let event = Event::PaymentPathFailed {

0 commit comments

Comments
 (0)