Skip to content

Commit

Permalink
Remove flaky tests (#342)
Browse files Browse the repository at this point in the history
* remove flaky timing-based test

* skip multiobjective NSGA2 tests

* skip only the n_obj=2 test
  • Loading branch information
ewu63 authored May 5, 2023
1 parent 298c48c commit 6acea68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/test_nsga2_multi_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def setup_optProb(self, n_obj):

@parameterized.expand([(1,), (2,)])
def test_opt(self, n_obj):
if n_obj == 2:
raise unittest.SkipTest("skip flaky NSGA2 tests")
self.setup_optProb(n_obj)

# 300 generations will find x=(0,0), 200 or less will find x=(1,1)
Expand Down
3 changes: 0 additions & 3 deletions tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,6 @@ def check_hist_file(self, tol):
times = hist.getValues(names="time", major=False)["time"]
# the times should be monotonically increasing
self.assertTrue(np.all(np.diff(times) > 0))
# the final time should be close to the metadata time
# we only specify a relatively loose atol because of variations in overhead cost between machines
assert_allclose(times[-1], metadata["optTime"], atol=1.0)

# this check is only used for optimizers that guarantee '0' and 'last' contain funcs
if self.optName in ["SNOPT", "PSQP"]:
Expand Down

0 comments on commit 6acea68

Please sign in to comment.