This is an automated email from the ASF dual-hosted git repository.
paulirwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git
The following commit(s) were added to refs/heads/master by this push:
new 690b175c0 Fix failing tests when local time zone has DST, #1133 (#1137)
690b175c0 is described below
commit 690b175c0fb003e93487cda2fa6a0e75ca3a5fe4
Author: Paul Irwin <[email protected]>
AuthorDate: Sat Mar 8 18:02:42 2025 -0700
Fix failing tests when local time zone has DST, #1133 (#1137)
---
src/Lucene.Net.TestFramework/Index/AlcoholicMergePolicy.cs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/Lucene.Net.TestFramework/Index/AlcoholicMergePolicy.cs
b/src/Lucene.Net.TestFramework/Index/AlcoholicMergePolicy.cs
index 610f47385..01484c028 100644
--- a/src/Lucene.Net.TestFramework/Index/AlcoholicMergePolicy.cs
+++ b/src/Lucene.Net.TestFramework/Index/AlcoholicMergePolicy.cs
@@ -42,9 +42,10 @@ public class AlcoholicMergePolicy : LogMergePolicy
public AlcoholicMergePolicy(TimeZoneInfo timeZone, Random random)
{
// LUCENENET NOTE: All we care about here is that we have a random
distribution of "Hour", picking any valid
- // date at random achives this. We have no actual need to create a
Calendar object in .NET.
- var randomTime = new DateTime(TestUtil.NextInt64(random,
DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks));
- this.calendar = TimeZoneInfo.ConvertTime(randomTime,
TimeZoneInfo.Local, timeZone);
+ // date at random achieves this. We have no actual need to create
a Calendar object in .NET.
+ var randomTicks = TestUtil.NextInt64(random,
DateTime.MinValue.Ticks, DateTime.MaxValue.Ticks);
+ var randomTime = new DateTime(randomTicks);
+ this.calendar = TimeZoneInfo.ConvertTime(randomTime,
TimeZoneInfo.Utc, timeZone);
this.random = random;
m_maxMergeSize = TestUtil.NextInt32(random, 1024 * 1024,
int.MaxValue);
}
@@ -73,4 +74,4 @@ private enum Drink
SingleMalt = 30
}
}
-}
\ No newline at end of file
+}