[PR #627] [MERGED] testing: make TestRecorder timestamps deterministic #668

Closed
opened 2026-03-02 23:47:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/627
Author: @simonklee
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @kommander

Base: mainHead: flaky-test-fix


📝 Commits (1)

  • 6f5fc4b testing: make TestRecorder timestamps deterministic

📊 Changes

2 files changed (+10 additions, -7 deletions)

View changed files

📝 packages/core/src/testing/test-recorder.test.ts (+5 -5)
📝 packages/core/src/testing/test-recorder.ts (+5 -2)

📄 Description

Allow an injected clock to drive recording timestamps so tests avoid wall-clock races.

Test now drives time explicitly (advance 10ms between renders), so the timestamps are deterministic.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/627 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `flaky-test-fix` --- ### 📝 Commits (1) - [`6f5fc4b`](https://github.com/anomalyco/opentui/commit/6f5fc4b306609835beca463211be201eca7c7f2a) testing: make TestRecorder timestamps deterministic ### 📊 Changes **2 files changed** (+10 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/testing/test-recorder.test.ts` (+5 -5) 📝 `packages/core/src/testing/test-recorder.ts` (+5 -2) </details> ### 📄 Description Allow an injected clock to drive recording timestamps so tests avoid wall-clock races. Test now drives time explicitly (advance 10ms between renders), so the timestamps are deterministic. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:35 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#668
No description provided.