Commit c73d890
Fix flaky EngineProcessor time filter tests (#8058)
This fix addresses the flaky tests in engine_processor_test.py as
explained in #7851.
The tests are fixed by mocking the `datetime.datetime` class with a
subclass
`_FrozenDateTime` to make `datetime.datetime.now()` return a constant.
I reproduced the issue by adding `import time; time.sleep(1)` to both
`test_get_schedule_time_filter_behavior` and
`test_list_reservations_time_filter_behavior` and confirmed that the fix
works for both cases (though I removed the sleeps for this pr).
Fixes #7851
---------
Co-authored-by: Pavol Juhas <juhas@google.com>1 parent f5300e0 commit c73d890
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
197 | 209 | | |
198 | 210 | | |
199 | 211 | | |
| |||
769 | 781 | | |
770 | 782 | | |
771 | 783 | | |
| 784 | + | |
772 | 785 | | |
773 | 786 | | |
774 | 787 | | |
| |||
811 | 824 | | |
812 | 825 | | |
813 | 826 | | |
| 827 | + | |
814 | 828 | | |
815 | 829 | | |
816 | 830 | | |
| |||
0 commit comments