Skip to content

RemoteAttacher unit tests timezone sensitive, underlying bug? #1839

@jas88

Description

@jas88

We have an issue in the RemoteAttacher date logic regarding timezones - it's calculating with local time rather than UTC, and what that timezone is depends on the server in question. Ideally need to switch the date handling in RemoteAttacher to use UTC for everything (DateTime.UtcNow not DateTime.Now in C#, GETUTCDATE() not GETDATE() on MS SQL, UTC_DATE() not DATE() on Oracle...)

This means CI occasionally fails depending on the time of day - the Github VMs are on Pacific time IIRC, so about one-third of the time the local date is a day behind the UTC date, causing an off-by-one which breaks those unit tests.

Not the first bit of RDMP to hit this; there's some older code that spent a while with a "Do not run this test late at night" label on it since it would fail for similar reasons between 11pm and midnight UK time six months of the year...

Originally posted by @jas88 in #1838 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions