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 test4 #7212

Merged
merged 4 commits into from
Feb 20, 2021
Merged

Fix flaky test4 #7212

merged 4 commits into from
Feb 20, 2021

Conversation

davimacedo
Copy link
Member

New Pull Request Checklist

  • [ X ] I am not disclosing a vulnerability.
  • [ X ] I am creating this PR in reference to an issue.

Issue Description

"RedisCacheAdapter should find un-expired records" and other similar tests are flaky because sometimes the cache expires before the first get since it has a very low ttl value. A similar test was fixed in the past but not all of them: https://github.com/parse-community/parse-server/pull/5686/files

Related issue: #7180

Approach

Basically I increased the default ttl for the cache adapter in the tests. I've run all tests 300 times with no failures.

TODOs before merging

  • Add test cases
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK
  • ...

@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #7212 (a7b5e27) into master (fd3c7fc) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7212      +/-   ##
==========================================
+ Coverage   94.00%   94.02%   +0.02%     
==========================================
  Files         172      172              
  Lines       12868    12868              
==========================================
+ Hits        12096    12099       +3     
+ Misses        772      769       -3     
Impacted Files Coverage Δ
src/Adapters/Files/GridFSBucketAdapter.js 79.50% <0.00%> (-0.82%) ⬇️
src/Controllers/DatabaseController.js 95.46% <0.00%> (-0.15%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 96.01% <0.00%> (+0.15%) ⬆️
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.92% <0.00%> (+0.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd3c7fc...f5df018. Read the comment docs.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

LGTM

@mtrezza
Copy link
Member

mtrezza commented Feb 20, 2021

Can we merge this one yet?

@mtrezza mtrezza mentioned this pull request Feb 20, 2021
4 tasks
@dplewis
Copy link
Member

dplewis commented Feb 20, 2021

I've run all tests 300 times

Do you have a script or gist I can use to do this too?

@dplewis dplewis merged commit a649a9e into parse-community:master Feb 20, 2021
dplewis pushed a commit that referenced this pull request Feb 21, 2021
* Increase timeout for redis tests

* Remove for

* Increase little bit more one of the tests since it requires two calls to be done in time-fahsion way

* increase default ttl a bit more
@davimacedo
Copy link
Member Author

davimacedo commented Feb 22, 2021

I've run all tests 300 times

Do you have a script or gist I can use to do this too?

I use to wrap the test(s) that I want to investigate with a for. Something like:

for (let x = 0; x < 300; x++) {
  fit(...);
}

@dplewis
Copy link
Member

dplewis commented Feb 22, 2021

I figured as much, I thought it was built into jasmine.

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Nov 1, 2021
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants