Really make the seed stable to YYYY-MM-DD (#154568)

`hashCode` is stable for the same inputs of `DateTime`; those inputs should be to the day only (oops).
This commit is contained in:
John McDole
2024-09-03 12:10:18 -07:00
committed by GitHub
parent 28a9124304
commit 6035698acb

View File

@@ -21,7 +21,8 @@ TaskFunction createMicrobenchmarkTask({
}) {
// Generate a seed for this test stable around the date.
final int seed = DateTime.now().toUtc().subtract(const Duration(hours: 7)).hashCode;
final DateTime seedDate = DateTime.now().toUtc().subtract(const Duration(hours: 7));
final int seed = DateTime(seedDate.year, seedDate.month, seedDate.day).hashCode;
return () async {
final Device device = await devices.workingDevice;