Skip to content

Disable console test for jitstressreg mode #63349

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

Merged
merged 2 commits into from
Jan 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 6 additions & 24 deletions src/libraries/System.Console/tests/ConsoleKeyInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@

using System.Collections.Generic;
using Xunit;
using Xunit.Abstractions;

namespace System.Tests
{
public class ConsoleKeyInfoTests
{
private readonly ITestOutputHelper _output;

public ConsoleKeyInfoTests(ITestOutputHelper output)
{
_output = output;
}

[Fact]
public void Ctor_DefaultCtor_PropertiesReturnDefaults()
{
Expand All @@ -41,27 +33,17 @@ public void Ctor_ValueCtor_ValuesPassedToProperties(bool shift, bool alt, bool c

[Theory]
[MemberData(nameof(SampleConsoleKeyInfos))]
[SkipOnCoreClr("https://github.com/dotnet/runtime/issues/60240", RuntimeTestModes.JitStressRegs)]
public void Equals_SameData(ConsoleKeyInfo cki)
{
ConsoleKeyInfo other = cki; // otherwise compiler warns about comparing the instance with itself

try
{
Assert.True(cki.Equals((object)other));
Assert.True(cki.Equals(other));
Assert.True(cki == other);
Assert.False(cki != other);

Assert.Equal(cki.GetHashCode(), other.GetHashCode());
}
catch
{
// Log more info in failure case to help investigate https://github.com/dotnet/runtime/issues/60240
_output.WriteLine($"ConsoleKeyInfo had KeyChar {cki.KeyChar} Key {cki.Key} Modifiers {cki.Modifiers}");
_output.WriteLine($"`cki.Equals(other)` gives {cki.Equals(other)} and `cki == other` gives {cki == other}");
Assert.True(cki.Equals((object)other));
Assert.True(cki.Equals(other));
Assert.True(cki == other);
Assert.False(cki != other);

throw;
}
Assert.Equal(cki.GetHashCode(), other.GetHashCode());
}

[Theory]
Expand Down