fix: add network tolerance to sync performance assertion#339
Merged
AniketDev7 merged 1 commit intodevelopmentfrom Mar 4, 2026
Merged
fix: add network tolerance to sync performance assertion#339AniketDev7 merged 1 commit intodevelopmentfrom
AniketDev7 merged 1 commit intodevelopmentfrom
Conversation
Problem: - The test "should compare initial vs delta sync performance" was failing intermittently due to network variability - Assertion expected deltaTime <= initialTime (strict) - In practice, small syncs (<100ms) have high variance from network latency - Example failure: initialTime=41ms, deltaTime=74ms (both fast, but failed) Solution: - Added hybrid tolerance: max(initialTime * 2, 100ms) - Allows 2x tolerance OR 100ms absolute threshold (whichever is larger) - Accounts for network variability while catching real performance regressions Impact: - Makes test more resilient to network conditions - Still catches meaningful performance degradation - Prevents false negatives from minor timing fluctuations
Coverage report
Test suite run success653 tests passing in 31 suites. Report generated by 🧪jest coverage report action from 79648d9 |
cs-raj
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
Solution:
Impact: