Skip to content

Harden logic when looking for syslog entries for failing test - #15841

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
JamesWTruher:SyslogTest001
Jul 30, 2021
Merged

Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
JamesWTruher:SyslogTest001

Conversation

@JamesWTruher

Copy link
Copy Markdown
Collaborator

PR Summary

Change and harden the logic when determining whether a syslog entry has been made. Rather than using the logid, I am determining whether or not a particular PID shows up as a syslog entry. This is a fix for #15814.

PR Context

PR Checklist

@ghost ghost assigned Ilya (iSazonov) Jul 29, 2021
@iSazonov Ilya (iSazonov) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Jul 29, 2021
Comment on lines +256 to +259
$items = Get-PSSysLog -Path $SyslogFile
@($items).Count | Should -BeGreaterThan 0
$logs = $items | Where-Object { $_.ProcessId -eq $result }
$logs | Should -BeNullOrEmpty

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the test previously assumed there would be no entries, but now we expect some entries but none with the PID data. What's changed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was added to make it more robust.

@iSazonov
Ilya (iSazonov) merged commit 881f31b into PowerShell:master Jul 30, 2021
@iSazonov Ilya (iSazonov) added this to the 7.2.0-preview.9 milestone Jul 30, 2021
@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.9 has been released which incorporates this pull request.:tada:

Handy links:

@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.10 has been released which incorporates this pull request.:tada:

Handy links:

@JamesWTruher
James Truher (JamesWTruher) deleted the SyslogTest001 branch September 23, 2023 05:36
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants