Skip to content
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

fix flaky SlidingBloomReplayCacheTest.cpp #96

Closed
wants to merge 1 commit into from

Conversation

ahornby
Copy link
Contributor

@ahornby ahornby commented Jul 22, 2023

fix flaky SlidingBloomReplayCacheTest.cpp

SlidingBloomReplayCacheTest.cpp test was flaky, looks like the expiry
can happen at exactly 1 second, moving to 1001 milliseconds fixed it.

Updated associated comments to remove the time periods as was
duplicative of the chrono call just below the comments

Test Plan:

Run locally

 ./build/fbcode_builder/getdeps.py build --src-dir=. fizz
 ./build/fbcode_builder/getdeps.py test --src-dir=. fizz

before, fails with:

[==========] 5 tests from 1 test suite ran. (1115 ms total)
[  PASSED  ] 4 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SlidingBloomReplayCacheTest.TestTimeBucketing

 1 FAILED TEST

after, passes with:

100% tests passed, 0 tests failed out of 68

Total Test time (real) =   1.07 sec


Stack created with Sapling. Best reviewed with ReviewStack.

@ahornby ahornby mentioned this pull request Jul 22, 2023
@ahornby ahornby marked this pull request as ready for review July 22, 2023 12:58
facebook-github-bot pushed a commit to facebook/sapling that referenced this pull request Jul 24, 2023
Summary:
github diffs were showing the full set of commits in the stack rather than just the commits for the given PR version

gitHubPullRequestComparableVersions was returning null for base commit,  which meant we always fell back on the } else if (afterBaseCommitID != null) { branch of gitHubPullRequestVersionDiff.  That fallback used to work fine, but now its giving us the base of the full stack rather than the base of the PR. I don't know how it worked before (perhaps github api behaviour changed?), but there you go!

Fix is to use the version.baseParent in gitHubPullRequestComparableVersions, which has the right value in it.

Pull Request resolved: #684

Test Plan:
yarn test --watchAll=false

Local build and run:

Before, https://reviewstack.dev/facebookincubator/fizz/pull/96 shows changes for full stack:
![image](https://github.com/facebook/sapling/assets/14246801/932463ed-9132-4efe-8672-92a72ca2bd7c)

After, http://localhost:3000/facebookincubator/fizz/pull/96 shows only relevant changes for PR:
![image](https://github.com/facebook/sapling/assets/14246801/7e8466b6-4a40-4d70-9bb6-7e4182294018)

Reviewed By: zzl0

Differential Revision: D47707437

Pulled By: sggutier

fbshipit-source-id: aeead996e11cddc68b844b63151e378247a4493e
Copy link
Contributor

@AjanthanAsogamoorthy AjanthanAsogamoorthy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the "// 1.5 seconds in, " comment as well

@ahornby
Copy link
Contributor Author

ahornby commented Jul 25, 2023

Can you fix the "// 1.5 seconds in, " comment as well

@AjanthanAsogamoorthy done, no need for the comment to repeat the chrono calls

SlidingBloomReplayCacheTest.cpp test was flaky,  looks like the expiry
can happen at exactly 1 second, moving to 1001 milliseconds fixed it.

Updated associated comments to remove the time periods as was
duplicative of the chrono call just below the comments

Test Plan:

Run locally

```
 ./build/fbcode_builder/getdeps.py build --src-dir=. fizz
 ./build/fbcode_builder/getdeps.py test --src-dir=. fizz
```

before, fails with:
```
[==========] 5 tests from 1 test suite ran. (1115 ms total)
[  PASSED  ] 4 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SlidingBloomReplayCacheTest.TestTimeBucketing

 1 FAILED TEST
```

after, passes with:
```
100% tests passed, 0 tests failed out of 68

Total Test time (real) =   1.07 sec

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants