-
Notifications
You must be signed in to change notification settings - Fork 4
fix calculation method for new_epoch #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the calculation method for new_epoch in the time manager test to improve test determinism. The change replaces a non-deterministic calculation based on the current time with a fixed offset from the default epoch.
- Changed
new_epochcalculation fromtime.time() - 86400 * 30toTMGR_DEFAULT_UNIXTIME_EPOCH_FOR_UTL + 86400 * 30 - Updated the comment to accurately reflect the new calculation method
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@meltingrabbit cc @sksat |
|
@hender14 これだと,デフォルトエポックが, ただ,エポックがそんなに最近なこともない気がするので,大丈夫な気もします. という悩ましい感じですね. |
|
@meltingrabbit 根本の対策にはなっていませんが、コメントで、epoch 時間が現在時刻-30day にならない様記載すると共に、実際に epoch が未来の時刻で設定された場合は assert でエラーとする事で対応できればと思いますが、如何でしょうか。 # NOTE: テスト内でこの値に +30日 などを加算して検証するケースがあるため、
# 現在時刻に対して十分過去(少なくとも30日以上前)の日時である必要がある。
TMGR_DEFAULT_UNIXTIME_EPOCH_FOR_UTL = 1577836800.0# new_epoch が未来になっていないかチェックし、失敗したらメッセージを出す
assert new_epoch < time.time(), "設定された Epoch が未来時刻になっている" |
|
@hender14 よさそうです! |
|
@meltingrabbit |
meltingrabbit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
良さそうです.ありがとうございます!
概要
FSW 側で ti の値がオーバーフローしない様に、new_epoch の値を小さくする
Issue
検証結果
補足
別途、c2a-pytest-gaia 側の epoch 設定を変える API が無いという問題はあり、此方は arkedge/c2a-pytest-gaia#8 にて対応していく