Closed Srceh closed 7 years ago
To avoid all these problems, we should just change the time intervals of the tutorials to at least some minutes or hours in the past.
HyperStream is only millisecond precise, so this comparison should be changed to remove microseconds.
Should now be fixed with https://github.com/IRC-SPHERE/HyperStream/commit/fb58a388c5f5e844032987ac5e180263e9637519
Would be good if someone were to write a unit test to verify this.
As I just reinstall my Ubuntu I tried to run Tutorial 1 again for a test.
The issue occurs in the (Executing a new interval) section, which I think is caused by the precision of utcnow() defined in hyperstream/utils/time_utils.py.
It is interesting I didn't have this issue in the past...
For instance:
interval.end = datetime.datetime(2017, 8, 18, 9, 41, 14, 262064, tzinfo=)
utcnow() = datetime.datetime(2017, 8, 18, 9, 41, 14, 262000, tzinfo=)
--> 139 raise ValueError("Calculated intervals should not be in the future") 140 141 self._calculated_intervals = value
ValueError: Calculated intervals should not be in the future