lance-format / lance-format/lance

Inject clock instead of using process-wide clock

Open
#1,174 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

Currently, if we need to get the current time, we use something like Utc::now or SystemTime::now. These use process-wide clocks, which is fine, but which are difficult to mock out for testing (see tests in the cleanup.rs). What we end up doing to test this is mocking out the process-wide clock but this means these tests cannot run in parallel (since they would interfere with each other's mocking).

Instead, we could make a dataset's clock configurable. This would allow us to change it during testing without impacting other running tests.

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 reading the clock-mocking tests in cleanup.rs and identify how dataset operations currently obtain the process-wide time. Define the dataset-level clock configuration and verify that tests can change it independently, without interfering with parallel tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data
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.