Closed maryamariyan closed 4 years ago
+ using System.Globalization;
[OuterLoop]
[ConditionalFact(Helpers.IsDriverAvailable)]
public void DeriveParameters_NullConnection_Throws()
{
+ Assert.True(CultureInfo.CurrentCulture.Name.Equals("en-US", StringComparison.OrdinalIgnoreCase));
+ CultureInfo.CurrentCulture = new CultureInfo("es-ES");
+ Assert.True(CultureInfo.CurrentCulture.Name.Equals("es-ES", StringComparison.OrdinalIgnoreCase));
RunTest((command, tableName) => {
using (var cmd = (OleDbCommand)OleDbFactory.Instance.CreateCommand())
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = @"SELECT * FROM " + tableName;
cmd.Connection = null;
AssertExtensions.Throws<InvalidOperationException>(
() => OleDbCommandBuilder.DeriveParameters(cmd),
$"{nameof(OleDbCommandBuilder.DeriveParameters)}: {nameof(cmd.Connection)} property has not been initialized.");
}
});
}
I tweaked one of the failing tests locally to just run the test with spanish locale, and I still get the test pass successfully for myself locally meanwhile the same tests was failing on the CI with following message: (Refer to here)
Unhandled Exception of Type System.Data.OleDb.OleDbException
Message :
System.Data.OleDb.OleDbException : Text file specification field separator matches decimal separator or text delimiter.
Stack Trace :
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) in /_/src/System.Data.OleDb/src/OleDbCommand.cs:line 893
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) in /_/src/System.Data.OleDb/src/OleDbCommand.cs:line 857
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) in /_/src/System.Data.OleDb/src/OleDbCommand.cs:line 812
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) in /_/src/System.Data.OleDb/src/OleDbCommand.cs:line 771
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) in /_/src/System.Data.OleDb/src/OleDbCommand.cs:line 622
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() in /_/src/System.Data.OleDb/src/OleDbCommand.cs:line 916
at System.Data.OleDb.Tests.OleDbCommandBuilderTests.RunTest(Action`2 testAction, String memberName) in /_/src/System.Data.OleDb/tests/OleDbCommandBuilderTests.cs:line 161
at System.Data.OleDb.Tests.OleDbCommandBuilderTests.DeriveParameters_NullConnection_Throws() in /_/src/System.Data.OleDb/tests/OleDbCommandBuilderTests.cs:line 53
Making this change didn't give me a local repro.
@maryamariyan could you try move the lines
Assert.True(CultureInfo.CurrentCulture.Name.Equals("en-US", StringComparison.OrdinalIgnoreCase));
CultureInfo.CurrentCulture = new CultureInfo("es-ES");
Assert.True(CultureInfo.CurrentCulture.Name.Equals("es-ES", StringComparison.OrdinalIgnoreCase));
inside the RunTest passed delegate?
I moved the assertions also inside RunTest and around the ExecuteNonQuery call shown in the above call stack. It didn't seem to produce a repro.
cc: @saurabh500
@maryamariyan The changes you made above for a repro, only changes the locale for C# test DeriveParameters_NullConnection_Throws
right ?
The error I believe should recur in case the Locale of the OS is changed to spanish. This error is coming from the OleDb layer which is simply being surfaced from OleDb provider.
Hence the OleDb driver would have to operate in the spanish locale.
Did you change the locale of the OS as well ?
I changed the region locale to (Spanish - Spain). I'll see if there's more settings I need to change to get this repro.
UPDATE: Got repro by making change below:
It wasn't the system locale, since changing the locale below doesn't cause that repro:
Closing as this is not something we plan to fix.
Found this issue while running OLEDB outerloop tests on the CI machines with Spanish locale. (Initially reported in PR https://github.com/dotnet/corefx/pull/38024)
The failure seems to be in Spanish SKU of Windows: where a text file created in US locale cannot be read on other computers as a delimited file. (For more info check here)
cc: @tarekgh @saurabh500