Skip to content

Commit 483049d

Browse files
Copilotachamayoucjen1-msft
authored
fix: loosen upper snapshot count bound in snapshot persistence test (#7865)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com> Co-authored-by: Amaury Chamayou <amchamay@microsoft.com> Co-authored-by: cjen1-msft <chrisjensen@microsoft.com>
1 parent 0fde46a commit 483049d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/e2e_operations.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,10 +3644,13 @@ def run_snapshot_persistence_across_primary_failure(const_args):
36443644

36453645
snapshot_interval_s = snapshot_interval_ms / 1000
36463646
election_timeout_s = args.election_timeout_ms / 1000
3647-
# In the worst case, each snapshot is delayed by one extra election timeout
3648-
# beyond the nominal snapshot interval while leadership is re-established.
3647+
# Lower bound: in the worst case each snapshot is delayed by one extra
3648+
# election timeout beyond the nominal snapshot interval while leadership
3649+
# is re-established.
36493650
min_expected = elapsed / (snapshot_interval_s + election_timeout_s * 1.2)
3650-
max_expected = elapsed / snapshot_interval_s * 0.9
3651+
# Upper bound: the theoretical maximum is elapsed / snapshot_interval_s.
3652+
# We add 1 to account for timing imprecision at the boundary.
3653+
max_expected = elapsed / (snapshot_interval_s * 0.9) + 1
36513654
LOG.info(
36523655
f"Elapsed: {elapsed:.1f}s, snapshots: {total_snapshots}, "
36533656
f"expected bounds [{min_expected:.1f}, {max_expected:.1f}] "

0 commit comments

Comments
 (0)