parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.81k stars 4.77k forks source link

Add test retry logic for flaky tests #8654

Closed mtrezza closed 2 weeks ago

mtrezza commented 1 year ago

New Feature / Enhancement Checklist

Current Limitation

There are still some flaky tests;

Feature / Enhancement Description

Add a test-retry logic on jasmine-level (not GitHub workflow level) specifically for flaky tests.

  1. Implement logic to retry specific tests if they fail, in the style of the existing custom test specifiers: https://github.com/parse-community/parse-server/blob/1850be45b17abdccae129811157ddef6feb52a34/spec/helper.js#L422
  2. Identify flaky tests
  3. Use retry-test-specifier for flaky tests

Alternatives / Workarounds

Manually re-run tests (status quo)

References

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

dplewis commented 1 month ago

@mtrezza I was just looking into doing something like this. Using the test name as an identifier would be the easiest way to go.

mtrezza commented 1 month ago

There may be ways; I've looked into this quite extensively with jasmine but I couldn't find a way given its architecture. Hence I published https://github.com/parse-community/parse-server/pull/8655 to document my findings, closed it and kept this issue open, in case someone finds a way in the future. I think I've spent more than a day on it. The challenge is to build something on top of, or integrated into jasmine, so we have the test stats, etc. It may not be difficult to re-run a test, but I couldn't find a way to do that so that jasmine understands what's happening.

Another approach that came to my mind was to maybe use the GitHub CI to automatically create a test run per spec file. So that instead of re-running all tests when one fails, only the spec file of the failing test needs to re-run. But this'd need to consider coverage reporting, not spamming our CI dashboard, etc.

parseplatformorg commented 2 days ago

🎉 This change has been released in version 7.3.0-alpha.7