fix(gateway): close Phase 3C audit gaps
This commit is contained in:
@@ -32,6 +32,17 @@ func TestFairPacerEightFlowSharesAndCapacitySteps(t *testing.T) {
|
||||
assertSyntheticCap(t, half, 500_000)
|
||||
}
|
||||
|
||||
func TestFairPacerBoundsCatchupAfterHostStall(t *testing.T) {
|
||||
start := time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)
|
||||
pacer := newFairPacer(8000)
|
||||
_ = pacer.reserveAt(start, "one", 1000)
|
||||
resumed := start.Add(100 * time.Millisecond)
|
||||
next := pacer.reserveAt(resumed, "one", 1000)
|
||||
if next.Before(resumed.Add(-fairPacerMaximumCatchup)) || next.After(resumed.Add(10*time.Millisecond)) {
|
||||
t.Fatalf("post-stall reservation = %s, want bounded catchup near %s", next, resumed)
|
||||
}
|
||||
}
|
||||
|
||||
func runSyntheticPacer(pacer *fairPacer, start, end time.Time, flows []string, next map[string]time.Time) []syntheticPacerDelivery {
|
||||
const packetBytes = 1000
|
||||
for _, flow := range flows {
|
||||
|
||||
Reference in New Issue
Block a user