You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m developing a service that compacts Parquet files in cloud storage and use the InMemory store for end-to-end testing. It works well for validating state after writes, but it currently lacks the ability to control or mock the last_modified timestamp of stored objects.
Currently, put in the InMemory store implementation always sets last_modified using Utc::now(), with no clear way to override it.
Is there an existing mechanism to override this behavior that I missed?
If not, should we introduce a time provider API? For example:
let mock_time = Arc::new(MockTimeProvider::new(Utc::now()));let store = InMemory::new().with_time_provider(mock_time.clone());
store.put();
mock_time.advance(TimeDelta::hours(1));
store.put();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I’m developing a service that compacts Parquet files in cloud storage and use the
InMemorystore for end-to-end testing. It works well for validating state after writes, but it currently lacks the ability to control or mock thelast_modifiedtimestamp of stored objects.Currently,
putin theInMemorystore implementation always setslast_modifiedusingUtc::now(), with no clear way to override it.Is there an existing mechanism to override this behavior that I missed?
If not, should we introduce a time provider API? For example:
Proof of concept gist
This would enable tests that depend on time-based logic, such as verifying lockfile expiration or deleting files older than a certain age.
If this approach is acceptable, I’m willing to open a PR implementing it.
Beta Was this translation helpful? Give feedback.
All reactions