Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/RDMP-188 Attempt fix for 2am UTC issue #1869

Merged
merged 13 commits into from
Jul 10, 2024
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: Build

# Run this workflow every time a new commit pushed to your repository

on: push
on:
push:
schedule:
- cron: '0 1 * * *'

env:
DOTNET_NOLOGO: 1
Expand Down Expand Up @@ -72,7 +75,6 @@ jobs:
files: ./db-ui.lcov ./db-core.lcov
flag-name: unit tests


tests_file_system:
name: Run File System Tests
runs-on: windows-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ public void TestRemoteDatabaseAttacherWithDateFilter(DatabaseType dbType, Scenar

if (duration == AttacherHistoricalDurations.Custom)
{
attacher.CustomFetchDurationStartDate = DateTime.Now.AddDays(-7);
attacher.CustomFetchDurationEndDate = DateTime.Now;
attacher.CustomFetchDurationStartDate = DateTime.UtcNow.AddDays(-7);
attacher.CustomFetchDurationEndDate = DateTime.UtcNow;
}

if (duration == AttacherHistoricalDurations.DeltaReading)
{
attacher.DeltaReadingStartDate = DateTime.Now.AddDays(-7);
attacher.DeltaReadingStartDate = DateTime.UtcNow.AddDays(-7);
attacher.DeltaReadingLookBackDays = 0;
attacher.DeltaReadingLookForwardDays = 5;
}
Expand All @@ -236,7 +236,7 @@ public void TestRemoteDatabaseAttacherWithDateFilter(DatabaseType dbType, Scenar

if (duration == AttacherHistoricalDurations.SinceLastUse)
{
job.LoadMetadata.LastLoadTime = DateTime.Now.AddDays(-1);// last used yesterday
job.LoadMetadata.LastLoadTime = DateTime.UtcNow.AddDays(-1);// last used yesterday
job.LoadMetadata.SaveToDatabase();
}
if (scenario == Scenario.MissingPreLoadDiscardedColumn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,19 @@ private static string Within(AttacherHistoricalDurations duration)
switch (duration)
{
case AttacherHistoricalDurations.Past24Hours:
return DateTime.Now.AddHours(-1).ToString();
return DateTime.UtcNow.AddHours(-1).ToString();
case AttacherHistoricalDurations.Past7Days:
return DateTime.Now.AddHours(-1).ToString();
return DateTime.UtcNow.AddHours(-1).ToString();
case AttacherHistoricalDurations.PastMonth:
return DateTime.Now.AddHours(-1).ToString();
return DateTime.UtcNow.AddHours(-1).ToString();
case AttacherHistoricalDurations.PastYear:
return DateTime.Now.AddHours(-1).ToString();
return DateTime.UtcNow.AddHours(-1).ToString();
case AttacherHistoricalDurations.SinceLastUse:
return DateTime.Now.AddHours(-1).ToString();
return DateTime.UtcNow.AddHours(-1).ToString();
case AttacherHistoricalDurations.Custom:
return DateTime.Now.AddDays(-1).ToString();
return DateTime.UtcNow.AddDays(-1).ToString();
case AttacherHistoricalDurations.DeltaReading:
return DateTime.Now.AddDays(-4).ToString();
return DateTime.UtcNow.AddDays(-4).ToString();
default:
return "fail";
}
Expand All @@ -292,19 +292,19 @@ private static string Outwith(AttacherHistoricalDurations duration)
switch (duration)
{
case AttacherHistoricalDurations.Past24Hours:
return DateTime.Now.AddDays(-2).ToString();
return DateTime.UtcNow.AddDays(-2).ToString();
case AttacherHistoricalDurations.Past7Days:
return DateTime.Now.AddDays(-8).ToString();
return DateTime.UtcNow.AddDays(-8).ToString();
case AttacherHistoricalDurations.PastMonth:
return DateTime.Now.AddMonths(-2).ToString();
return DateTime.UtcNow.AddMonths(-2).ToString();
case AttacherHistoricalDurations.PastYear:
return DateTime.Now.AddYears(-2).ToString();
return DateTime.UtcNow.AddYears(-2).ToString();
case AttacherHistoricalDurations.SinceLastUse:
return DateTime.Now.AddDays(-2).ToString();
return DateTime.UtcNow.AddDays(-2).ToString();
case AttacherHistoricalDurations.Custom:
return DateTime.Now.AddDays(-14).ToString();
return DateTime.UtcNow.AddDays(-14).ToString();
case AttacherHistoricalDurations.DeltaReading:
return DateTime.Now.AddDays(-10).ToString();
return DateTime.UtcNow.AddDays(-10).ToString();
default:
return "fail";
}
Expand Down Expand Up @@ -351,17 +351,17 @@ private void RunAttachStageWithFilterJob(RemoteTableAttacher attacher, Discovere
job.StartLogging();
if (duration == AttacherHistoricalDurations.SinceLastUse)
{
job.LoadMetadata.LastLoadTime = DateTime.Now.AddDays(-1);// last used yesterday
job.LoadMetadata.LastLoadTime = DateTime.UtcNow.AddDays(-1);// last used yesterday
job.LoadMetadata.SaveToDatabase();
}
if (duration == AttacherHistoricalDurations.Custom)
{
attacher.CustomFetchDurationStartDate = DateTime.Now.AddDays(-7);
attacher.CustomFetchDurationEndDate = DateTime.Now;
attacher.CustomFetchDurationStartDate = DateTime.UtcNow.AddDays(-7);
attacher.CustomFetchDurationEndDate = DateTime.UtcNow;
}
if (duration == AttacherHistoricalDurations.DeltaReading)
{
attacher.DeltaReadingStartDate = DateTime.Now.AddDays(-7);
attacher.DeltaReadingStartDate = DateTime.UtcNow.AddDays(-7);
attacher.DeltaReadingLookBackDays = 0;
attacher.DeltaReadingLookForwardDays = 5;
}
Expand Down