8000 test(tasks): keep the intended created dates in the task list query tests by ahmet-cetinkaya · Pull Request #353 · ahmet-cetinkaya/whph · GitHub
[go: up one dir, main page]

Skip to content

test(tasks): keep the intended created dates in the task list query tests - #353

Merged
ahmet-cetinkaya merged 1 commit into
mainfrom
fix/task-tied-rank-test-flake
Dec 4, 2026
Merged

ahmet-cetinkaya merged 1 commit into
mainfrom
fix/task-tied-rank-test-flake

Conversation

@ahmet-cetinkaya
Copy link
Copy Markdown
Owner

Summary

Fix a flaky test: the custom-sort tie-break test in the task list query tests failed at random in CI.

Cause

DriftBaseRepository.add stamps created_date with the current time, kept at whole-second precision. The test gives all tasks one shared creation date and relies on the id tie-break, but add replaced it. When a second boundary fell between two inserts, the tasks got different dates and the tied ranks reordered. This is the same cause as #352, on the task side.

Changes

  • task_queries_integration_test.dart: a helper writes the intended creation date back after add; every task insert in the file uses it. No production code changed.

Testing

  • The file passes (11 of 11).
  • Mutation check: delaying one insert by 1.1 s without the write-back fails the test with [custom-b, custom-a, custom-c], the CI symptom.

…ests

The repository stamps created_date with the current time on add, at
whole-second precision. Tasks added across a second boundary lost the
shared date the custom-sort tie-break test sets, so the sort reordered
tied ranks at random. The tests now write the intended created date back
after the add.
@ahmet-cetinkaya
ahmet-cetinkaya merged commit 9161527 into main Dec 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0