Skip to content

EventLogCollector test flaky: WriteEventLogEntriesToXmlFileShouldWriteLogEntryIfPresent depends on machine state #15601

@nohwnd

Description

@nohwnd

Problem

\WriteEventLogEntriesToXmlFileShouldWriteLogEntryIfPresent\ in \Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests\ fails intermittently because it reads from the Windows Application Event Log and expects matching entries to exist.

On clean or quiet machines there may be no matching entries, causing the test to fail.

Reproduction

Run \ est.cmd\ locally — the test fails when the Application event log doesn't have recent entries matching the test's filter.

Suggested fix

Mock the event log source or write a known entry before the test runs, so the test is deterministic regardless of machine state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions