Skip to content

Нестабильный тест дат создания и изменения файла - #1749

Merged
EvilBeaver merged 1 commit into
EvilBeaver:developfrom
sfaqer:bugfix/file-dates-test
Sep 26, 2026
Merged

EvilBeaver merged 1 commit into
EvilBeaver:developfrom
sfaqer:bugfix/file-dates-test

Conversation

@sfaqer

@sfaqer sfaqer commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

ТестДолжен_ПроверитьПолучениеДатСозданияИИзменения (tests/file-object.os) сравнивал время изменения файла с моментом до записи с допуском 2 секунды. На Windows-агенте Jenkins запись заняла 3 секунды, и тест упал в #1747 (25.09.2026 09:27:14 против 09:27:17), хотя код там ни при чём. Правка 95c879c (сравнение с точностью до секунды) запаса не добавила.

Теперь время создания и время изменения должно попасть в интервал между моментами до и после записи, с запасом в секунду — на округление до секунд и шаг времени в 2 секунды у FAT32. Проверка по-прежнему ловит неверное время (не тот файл, UTC вместо местного и т.п.), но не зависит от скорости диска.

Проверил, вставив паузу 3,5 с между моментом «до записи» и записью: старая версия падает ровно как на CI, новая проходит.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated file timestamp checks to account for one-second precision and timing variation.
    • Continued to verify that creation precedes modification and skip filesystems that do not support creation timestamps.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8aff73b4-340b-43bf-88f0-7bd0d109fd1a

📥 Commits

Reviewing files that changed from the base of the PR and between 270202a and 3384888.

📒 Files selected for processing (1)
  • tests/file-object.os

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The timestamp test now validates creation and modification times against intervals captured before and after each write. A helper truncates times to seconds and allows one second of tolerance. The test retains its filesystem support skip, three-second pause, and creation-before-modification check.

Changes

File timestamp tests

Layer / File(s) Summary
Timestamp interval validation
tests/file-object.os
A helper checks timestamps against second-truncated interval bounds with one-second tolerance. The test captures an interval around each write and checks the reported timestamps against it.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: evilbeaver

Merge Risk: ⚪ Minimal · up to 33848

This test change accommodates the supported filesystem timestamp precision without admitting a materially stale timestamp, so no material merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 33848

The change affects 1 system.

Changed systems: tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in tests/file-object.os: Added ПроверитьДатуВИнтервале, which truncates the supplied timestamp and interval endpoints to seconds, then checks that it is no earlier than the start minus one second and no later than the end plus one second.
  • observed — Modified behavior in tests/file-object.os: The timestamp test now captures the time immediately before and after each write and validates creation and modification times against those respective intervals. This replaces comparisons with a single captured current time; the filesystem support skip and three-second pause remain.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно описывает основное изменение: исправление нестабильного теста дат создания и изменения файла.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

ТестДолжен_ПроверитьПолучениеДатСозданияИИзменения сравнивал время файла
с моментом до записи с допуском 2 секунды и падал на медленном агенте CI,
где запись занимала 3 секунды. Теперь время создания и изменения должно
попасть в интервал между моментами до и после записи.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sfaqer
sfaqer force-pushed the bugfix/file-dates-test branch from 3e4953a to 3384888 Compare September 25, 2026 07:45
@EvilBeaver
EvilBeaver merged commit dabf321 into EvilBeaver:develop Sep 26, 2026
1 of 2 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.

2 participants