linkerd / linkerd/linkerd2

proxy: Consider using `tokio-test`

Open
#2,802 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/proxy area/test
Dominant language
Go
Stars
11.5k
Forks
1.4k
Avg merge
3d 22h
Merged PRs (30d)
53

Description

The proxy currently has a number of tests that rely on having the thread sleep for an amount of time. Now that the [`tokio-test` crate](https://github.com/tokio-rs/tokio/tree/master/tokio-test), which provides mocking utilities for `tokio-timer`, has been released, we might want to look into rewriting these tests to use mocked timers.

There may be other test utilities in `tokio-test` that can simplify other tests in the proxy test suite as well.

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the proxy test suite and identify tests that sleep for timing. Read the tokio-test documentation and inspect its mocked-timer utilities, then check whether other tokio-test helpers apply to the suite. Done means replacing appropriate real-time waits with reliable mocked-timer tests without changing their intended coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.