Skip to content
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

Test: System.Data.Tests.SqlTypes.SqlStringTest/SqlDateTimeToSqlString failed with "Xunit.Sdk.EqualException" #23192

Closed
ghost opened this issue Aug 16, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Aug 16, 2017

Opened on behalf of @JiayiLi1

The test System.Data.Tests.SqlTypes.SqlStringTest/SqlDateTimeToSqlString has failed.

Assert.Equal() Failure\r
? (pos 0)\r
Expected: 10/22/2002 9:52:30 AM\r
Actual: 22/10/2002 9:52:30 AM\r
? (pos 0)

    Stack Trace:

       at System.Data.Tests.SqlTypes.SqlStringTest.SqlDateTimeToSqlString()

Build : UWP 6.0 - 20170815.01 (UWP F5 Tests)
Failing configurations:

  • Windows.10.Amd64.ClientRS3-x86
    • Debug

Detail: https://mc.dot.net/#/product/netcore/uwp60/source/official~2Fcorefx~2Frelease~2Fuwp6.0~2F/type/test~2Ffunctional~2Fuwp~2F/build/20170815.01/workItem/System.Data.Common.Tests/analysis/xunit/System.Data.Tests.SqlTypes.SqlStringTest~2FSqlDateTimeToSqlString

@danmoseley
Copy link
Member

@tarekgh I'm guessing all of these need to be changed to run remotely:

C:\git\corefx\src\System.Data.Common\tests\System\Data\DataColumnTest2.cs:
   42:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\DataSetReadXmlSchemaTest.cs:
   58:             CultureInfo.CurrentCulture = new CultureInfo("fi-FI");

C:\git\corefx\src\System.Data.Common\tests\System\Data\DataSetTest.cs:
   50:             CultureInfo.CurrentCulture = new CultureInfo("fi-FI");

C:\git\corefx\src\System.Data.Common\tests\System\Data\DataSetTest2.cs:
 1013:                 CultureInfo.CurrentCulture = new CultureInfo("cs-CZ");

C:\git\corefx\src\System.Data.Common\tests\System\Data\DataTableReadXmlSchemaTest.cs:
   56:             CultureInfo.CurrentCulture = new CultureInfo("fi-FI");

C:\git\corefx\src\System.Data.Common\tests\System\Data\DataTableTest.cs:
  853:                 CultureInfo.CurrentCulture = new CultureInfo("en-US");
 3329:                 CultureInfo.CurrentCulture = new CultureInfo("en-GB");
 4054:                 CultureInfo.CurrentCulture = new CultureInfo("en-US");
 4095:             CultureInfo.CurrentCulture = new CultureInfo("it-IT");
 4098:             CultureInfo.CurrentCulture = new CultureInfo("fr-FR");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlBooleanTest.cs:
   41:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlBytesTest.cs:
   36:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlByteTest.cs:
   41:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlCharsTest.cs:
   41:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlDateTimeTest.cs:
   53:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlDecimalTest.cs:
   49:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlDoubleTest.cs:
   45:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlMoneyTest.cs:
   44:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlSingleTest.cs:
   39:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlStringTest.cs:
   54:             CultureInfo.CurrentCulture = new CultureInfo("en-AU");

C:\git\corefx\src\System.Data.Common\tests\System\Data\SqlTypes\SqlXmlTest.cs:
   41:             CultureInfo.CurrentCulture = new CultureInfo("en-US");

@danmoseley
Copy link
Member

(Not suggesting you do it , just thinking aloud)

@tarekgh
Copy link
Member

tarekgh commented Aug 16, 2017

Yes, in general setting current culture or current UI culture should be done remotely in our tests.

@danmoseley
Copy link
Member

@corivera the correct pattern is something like

    public class TestFixtureName: RemoteExecutorTestBase
    {
...
        [Fact]
        public void TestName()
        {
            RemoteInvoke(() =>
            {
                CultureInfo.CurrentCulture = new CultureInfo("en-US");
                // body of test

                return SuccessExitCode;
            }).Dispose();
        }

All the tests setting CurrentCulture should follow this pattern. There's some others outside of System.Data.Common but most likely fixing these should avoid this particular test failure.

@danmoseley
Copy link
Member

@nchikanov perhaps you coudl grab this cleanup as a quick stocking stuffer task?
note there are others in the tree that don't use remote (search for setting CurrentCulture) but these at least are worth doing..

@danmoseley
Copy link
Member

@nchikanov can you please prepare a port to release/uwp6.0 and send mail to get commit permission.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the UWP6.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants