Skip to content

Commit 851d38f

Browse files
JasonKChowfacebook-github-bot
authored andcommitted
make test_time_limit even more loose (#451)
Summary: Pull Request resolved: #451 Sometimes test_time_limit will fail on very fast devices (https://github.com/facebookresearch/aepsych/actions/runs/11827946255/attempts/1). We make this test even more loose and add extra logging to help debug in future. Reviewed By: crasanders Differential Revision: D65923982 fbshipit-source-id: 49751b6140f899a4ff9837ba05f41724aa6b2503
1 parent 6605760 commit 851d38f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/generators/test_optimize_acqf_generator.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def test_time_limits(self):
6262
short = end - start
6363

6464
# very loose test because fit time is only approximately computed
65-
self.assertTrue(long > short)
65+
# on very fast machines, short sometimes actually wins, but hopefully not by
66+
# much
67+
self.assertTrue(long - short > -0.05, f"Long time: {long}, short time: {short}")
6668

6769
def test_instantiate_eubo(self):
6870
config = """

0 commit comments

Comments
 (0)