Skip to content

Mock System Clock for FileLoggerProcessor Tests #34807

@wtgodbe

Description

@wtgodbe

Right now these tests don't run if it's close to midnight, so that they don't have to account for the file number wrapping back to 0 in the middle of test execution. This also means we don't have any tests that verify that file names/numbers behave correctly on the new day boundary. We should mock the system clock like SignalR does so we can test his behavior: https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/common/Shared/ISystemClock.cs

var now = DateTimeOffset.Now;
if (now.Hour == 23)
{
// Don't bother trying to run this test when it's almost midnight.
return;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsgood first issueGood for newcomers.help wantedUp for grabs. We would accept a PR to help resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions