Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Third-Party Package
This third-party package's source repository does not contain a package manifest. Instead, its package manifest is stored in its release repository. In order to build this package from source in a Catkin workspace, please download its package manifest.Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Third-Party Package
This third-party package's source repository does not contain a package manifest. Instead, its package manifest is stored in its release repository. In order to build this package from source in a Catkin workspace, please download its package manifest.Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file
Wiki Tutorials
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged flaky at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 3.1.0 |
License | Apache |
Build type | CATKIN |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/box/flaky.git |
VCS Type | git |
VCS Version | v3.1.0 |
Last Updated | 2016-02-11 |
Dev Status | MAINTAINED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- AlexV
Authors
flaky
About
Flaky is a plugin for nose or py.test that automatically reruns flaky tests.
Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100% reliable. With flaky, instead of removing those tests or marking them to \@skip, they can be automatically retried.
For more information about flaky, see this presentation.
Marking tests flaky
To mark a test as flaky, simply import flaky and decorate the test with \@flaky:
from flaky import flaky
@flaky
def test_something_that_usually_passes(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
By default, flaky will retry a failing test once, but that behavior can be overridden by passing values to the flaky decorator. It accepts two parameters: max_runs, and min_passes; flaky will run tests up to max_runs times, until it has succeeded min_passes times. Once a test passes min_passes times, it's considered a success; once it has been run max_runs times without passing min_passes times, it's considered a failure.
@flaky(max_runs=3, min_passes=2)
def test_something_that_usually_passes(self):
"""This test must pass twice, and it can be run up to three times."""
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
Marking a class flaky
In addition to marking a single test flaky, entire test cases can be marked flaky:
@flaky
class TestMultipliers(TestCase):
def test_flaky_doubler(self):
value_to_double = 21
result = get_result_from_flaky_doubler(value_to_double)
self.assertEqual(result, value_to_double * 2, 'Result doubled incorrectly.')
@flaky(max_runs=3)
def test_flaky_tripler(self):
value_to_triple = 14
result = get_result_from_flaky_tripler(value_to_triple)
self.assertEqual(result, value_to_triple * 3, 'Result tripled incorrectly.')
The \@flaky class decorator will mark test_flaky_doubler as flaky, but it won't override the 3 max_runs for test_flaky_tripler (from the decorator on that test method).
Don't rerun certain types of failures
Depending on your tests, some failures are obviously not due to flakiness. Instead of rerunning after those failures, you can specify a filter function that can tell flaky to fail the test right away.
def is_not_crash(err, *args):
return not issubclass(err[0], ProductCrashedError)
@flaky
def test_something():
raise ProductCrashedError
@flaky(rerun_filter=is_not_crash)
def test_something_else():
raise ProductCrashedError
File truncated at 100 lines see the full file