Skip to content

S2 的共用限流測試偶發失敗:兩次請求間隔量到 0.92 秒,斷言是 ≥ 0.95 秒 #701

Description

@kiki830621

Problem

S2CommandTests.testTwoProcessesShareTheOneRequestPerSecondBudget 會偶發失敗:兩個 akashic 程序共用每秒 1 次的額度,測試斷言兩次請求的間隔 ≥ 0.95 秒,實測有一次是 0.92 秒。

2026-09-30 在一條只改 Sources/akashic-guards/ 的分支上跑全套,失敗 1 次;單獨跑這一支 3 次,失敗 1 次。那條分支沒有碰 S2 的程式,所以這是既有的不穩定。

Type

bug

Expected

  • 先判斷 0.92 秒是量測誤差,還是限流本身真的讓兩次請求靠得太近。看 S2FileThrottle 預約時段的方式,以及測試怎麼量「請求送出的時間」:它量到的若是程序啟動或 stub 回應的時間,而不是 flock 預約之後的送出時間,就會有這種誤差。
  • 限流正確:斷言改成量預約的時段,或把容差寫明並附理由。
  • 限流不正確:修限流,測試不放寬。

Actual

全套測試偶爾因這一支紅燈。pre-push 跑全套,所以它也會偶爾擋下與 S2 無關的 push。


Source: #688/#689/#690 實作時的全套測試(2026-09-30)


Current Status

Phase: verified(R1 ensemble:沒有 HIGH;DA 對真的 S2FileThrottle 壓測,沒有找到小於 1.05 秒的間隔或飢餓)
Last updated: 2026-09-30 by idd-update

Blocking

  • (none)——等你 /idd-close;單一呼叫者的吞吐量慢約 5%,代價已寫進 changelog,要改只保證間隔的做法請說

Commits

  • cbc7d400(實作)
  • 55b4b5b9(R1 修正:changelog 揭露)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions