Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Every wait panics on a large timeout ("overflow when adding duration to instant")

Open
#629 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli, testing

Research direction

Start in the named wait methods in terminal.rs around lines 3422, 3602, 3760, 3944, and 4101, and check how the builder timeout reaches default-deadline waits. Add a shared checked-add helper with a far-future fallback, then add a test for each wait using Duration::MAX and verify the builder timeout case also works.

Written by the indexing model from the issue text.

Description

bug good first issue

What happens. Passing Duration::MAX, a common way to say "no deadline", panics:

  • wait_until_for(.., Duration::MAX) panics at terminal.rs:3422.
  • wait_exit_for panics at :4101.
  • wait_idle_for(50ms, Duration::MAX) panics at :3760.
  • wait_frame_for panics at :3602.
  • Terminal::builder().timeout(Duration::MAX) makes every default-deadline wait panic the same way.
overflow when adding duration to instant

send_str with that builder works, because std's recv_timeout saturates.

Cause. Instant::now() + timeout in wait_until (:3422, which also serves snapshot_after and wait_until_matches), wait_frame (:3602), wait_idle (:3760), wait_stable (:3944) and wait_exit (:4101).

Fix. Use Instant::now().checked_add(timeout) with a far-future fallback, in one helper the five sites share.

Done when each wait accepts Duration::MAX (and a builder timeout of Duration::MAX), with a test per wait.

Dominant language
Rust
Stars
28
Forks
24
Avg merge
11h 23m
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vyncint/termlens

All issues in vyncint/termlens

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.