Cannot make the tests to pass #12

Closed
callixte opened this Issue Feb 1, 2013 · 14 comments

Projects

None yet

2 participants

@callixte
callixte commented Feb 1, 2013

HI there,

I am trying to recompile this driver, but the tests are failing. I tested against a 8.4, 9.0 and 9.2 server, I always have some that are failing.
Maybe I am missing something.
I use VS2010 solution, clean the db and regenerate it everytime, but I still have some tests failing.
Thanks.

@franciscojunior
Member

Hi!

Some Npgsql tests are really failing. 31 tests are failing to be exact. How
many tests are failing to you?

On Fri, Feb 1, 2013 at 4:33 PM, Callixte Cauchois
notifications@github.comwrote:

HI there,

I am trying to recompile this driver, but the tests are failing. I tested
against a 8.4, 9.0 and 9.2 server, I always have some that are failing.
Maybe I am missing something.
I use VS2010 solution, clean the db and regenerate it everytime, but I
still have some tests failing.
Thanks.


Reply to this email directly or view it on GitHubhttps://github.com/franciscojunior/Npgsql2/issues/12.

Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://gplus.to/franciscojunior
http://fxjr.blogspot.com
http://twitter.com/franciscojunior

@callixte
callixte commented Feb 1, 2013

36 currently using roji's tests branch against a 9.0 server:

  • 3 in CommandTests
  • 3 in CommandTestsV2
  • 3 in ConnectionTests
  • 3 in ConnectionTestsV2
  • 3 in DataAdapterTests
  • 1 in DataAdapterTestsV2
  • 3 in DataReaderTests
  • 3 in DataReaderTestsV2
  • 9 in NpgsqlParameterTest
  • 3 in SystemTransactionsTest
  • 2 in SystemTransactionsTestV2
@franciscojunior
Member

Hmmmmm, can you post the nunit log where it shows the failing tests?
Are you running those tests on osx or linux?

On Fri, Feb 1, 2013 at 4:52 PM, Callixte Cauchois
notifications@github.comwrote:

36 currently using roji's tests branch against a 9.0 server:

  • 3 in CommandTests

  • 3 in CommandTestsV2

  • 3 in ConnectionTests

  • 3 in ConnectionTestsV2

  • 3 in DataAdapterTests

  • 1 in DataAdapterTestsV2

  • 3 in DataReaderTests

  • 3 in DataReaderTestsV2

  • 9 in NpgsqlParameterTest

  • 3 in SystemTransactionsTest

  • 2 in SystemTransactionsTestV2


    Reply to this email directly or view it on GitHubhttps://github.com/franciscojunior/Npgsql2/issues/12#issuecomment-13008213.

Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://gplus.to/franciscojunior
http://fxjr.blogspot.com
http://twitter.com/franciscojunior

@callixte
callixte commented Feb 1, 2013

I run them either in VS2010 using the Resharper tool or using nunit.exe. I am on Windows 7.
Here are the logs from nunit:

But was: ]]> d__b.MoveNext() in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlState.cs:line 850 at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1175 at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1191 at Npgsql.ForwardsOnlyDataReader.NextResult() in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1377 at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:line 1040 at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 611 at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb) in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 591 at Npgsql.NpgsqlCommand.ExecuteReader() in C:\VirtuOz\Npgsql2\src\Npgsql\NpgsqlCommand.cs:line 551 at NpgsqlTests.CommandTests.NegativeMoneySupport() in C:\VirtuOz\Npgsql2\testsuite\noninteractive\NUnit20\CommandTests.cs:line 3569 ]]> But was: ]]>
@franciscojunior
Member

I think github didn't like very much this result log file. :)

I could identify an error which is really a bug in Npgsql and I have to investigate it more:
ERREUR: 22P02: syntaxe en entrée invalide pour le type money

I noticed that if your currency type isn't english it will have problems with negative money value.

About the reference null exception with the bytea test, I'll have to check it.

I'm not being able to see the rest of the log. Would you mind to use pastebin or maybe create a gist with the log so we can have a better look at it?

@callixte
callixte commented Feb 1, 2013

Sorry, got caught in a meeting before I could do so.
Here is the gist: https://gist.github.com/4693761
I'll change the currency and collation to english and tell you the results.

@franciscojunior
Member

No problem.

There are a lot of errors which really aren't fixed in Npgsql. E.g. name="NpgsqlTests.NpgsqlParameterTest.InferType_TimeSpan"

Others are strange, like this one: ERREUR: 25001: SET TRANSACTION ISOLATION LEVEL doit être appelé avant toute requête

and this one:

I'll check them when I get home tonight and I'll let you know what I find.

@callixte
callixte commented Feb 1, 2013

Two tests are now green using US English locale.
I have updated the gist.

@franciscojunior
Member

It seems to be ok now. The only problem seems to be those
System.NullReferenceException in the GetBytes and GetBytesSequential.

The remaining bugs are really bugs of Npgsql which aren't fixed yet. I hope
to start fixing them soon.

On Fri, Feb 1, 2013 at 6:40 PM, Callixte Cauchois
notifications@github.comwrote:

Two tests are now green using US English locale.
I have updated the gist.


Reply to this email directly or view it on GitHubhttps://github.com/franciscojunior/Npgsql2/issues/12#issuecomment-13013043.

Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://gplus.to/franciscojunior
http://fxjr.blogspot.com
http://twitter.com/franciscojunior

@callixte
callixte commented Feb 4, 2013

It seems that when ByteaSupport() test is called, there is no data in TableF. I first thought it was because of the tests order, but they seem to execute in a correct sequence, those inserting data are executed before.
I now think it is due to the isolation. I didnot change the value of config. What have you got there?

@franciscojunior
Member

This is the tests result I get when running on Mono on OSX
https://gist.github.com/4710273

You should have a row in the tablef though. Check the add_data.sql and try to add the missing row. Tests assume the row is there. I think this is the cause of the Null reference exceptions.

@callixte
callixte commented Feb 6, 2013

SO I have fixed the add_data.sql scrpt to get data into TableF and that deals with the NullRefException I was having. We still have discrepencies in the tests that pass:

  1. NpgsqlTests.CommandTests.FunctionCallStringEscape : passes for me
  2. NpgsqlTests.CommandTests.DataTypeTests : same
    NpgsqlTests.CommandTests.NegativeMoneySupport : fails for me
  3. NpgsqlTests.CommandTestsV2.CommandTests.ByteaInsertWithPrepareSupport : passes for me
  4. NpgsqlTests.CommandTestsV2.CommandTests.Bug1010788UpdateRowSource : passes for me
  5. NpgsqlTests.CommandTestsV2.CommandTests.DataTypeTests : same
    NpgsqlTests.CommandTests.NegativeMoneySupport : fails for me
  6. NpgsqlTests.ConnectionTests.NpgsqlErrorRepro1 : same
    NpgsqlTests.ConnectionTests.Bug1011001 : fails for me
    NpgsqlTests.ConnectionTests.UseAllConnectionsInPool : fails for me NpgsqlTests.ConnectionTestsV2.NpgsqlErrorRepro1 : fails for me
    NpgsqlTests.ConnectionTestsV2.Bug1011001 : fails for me
    NpgsqlTests.ConnectionTestsV2.UseAllConnectionsInPool : fails for me
  7. NpgsqlTests.DataAdapterTests.InsertWithDataSet : passes for me
  8. NpgsqlTests.DataAdapterTests.DataAdapterUpdateReturnValue2 : same
  9. NpgsqlTests.DataAdapterTests.UpdateLettingNullFieldValue : passes
  10. NpgsqlTests.DataAdapterTests.UpdateWithDataSet : same
  11. NpgsqlTests.DataAdapterTests.InsertWithCommandBuilderCaseSensitive : same
  12. NpgsqlTests.DataAdapterTestsV2.DataAdapterTests.InsertWithDataSet : passes
  13. NpgsqlTests.DataAdapterTestsV2.DataAdapterTests.DataAdapterUpdateReturnValue2 : same
  14. NpgsqlTests.DataAdapterTestsV2.DataAdapterTests.UpdateLettingNullFieldValue : passes
  15. NpgsqlTests.DataReaderTests.GetBytesSequential : same
    NpgsqlTests.DataReaderTests.GetBytes : fails
  16. NpgsqlTests.DataReaderTestsV2.DataReaderTests.GetBytesSequential : same
    NpgsqlTests.DataReaderTestsV2.DataReaderTests.GetBytes : fails
  17. NpgsqlTests.NpgsqlParameterTest.InferType_Enum : same
  18. NpgsqlTests.NpgsqlParameterTest.InferType_Invalid : same
  19. NpgsqlTests.NpgsqlParameterTest.InferType_TimeSpan : same
  20. NpgsqlTests.NpgsqlParameterTest.ParameterType : same
  21. NpgsqlTests.NpgsqlParameterTest.ParameterName : same
  22. NpgsqlTests.NpgsqlParameterTest.SourceColumn : same
  23. NpgsqlTests.NpgsqlParameterTest.NpgsqlDbTypeTest_Value_Invalid : same
  24. NpgsqlTests.NpgsqlParameterTest.NpgsqlTypes_NpgsqlTimeStamp : same
  25. NpgsqlTests.NpgsqlParameterTest.Value : same
  26. NpgsqlTests.SystemTransactionsTest.DistributedTransactionRollback : passes
  27. NpgsqlTests.SystemTransactionsTest.FunctionTestTimestamptzParameterSupport : same
  28. NpgsqlTests.SystemTransactionsTest.TwoDistributedInSequence : same
  29. NpgsqlTests.SystemTransactionsTest.ReuseConnection : same
  30. NpgsqlTests.SystemTransactionsTestV2.SystemTransactionsTest.DistributedTransactionRollback : same
  31. NpgsqlTests.SystemTransactionsTestV2.SystemTransactionsTest.FunctionTestTimestamptzParameterSupport : passes
  32. NpgsqlTests.SystemTransactionsTestV2.SystemTransactionsTest.TwoDistributedInSequence : same
  33. NpgsqlTests.SystemTransactionsTestV2.SystemTransactionsTest.ReuseConnection : same

I investigated a bit the NegativeMonetarySupport: when I set lc_monetary to 'English, United States', it fails because I get back '($10.50)' from the server which is interpreted as 10.5. When I set it to 'French, France', I get back '-€10,50' which is correctly interprted, but I have to send '-10,5'.
What is your lc_monetary?

Overall, which do you think the most strange?

@franciscojunior
Member

I think those differences exist because I'm using Mono and you are using ms.net. I remember that Npgsql has problems with the data adapter and dataset tests when running under Mono. I still need to investigate that more.

About the monetary problem, I have en_US.UTF-8 and my lc_monetary.
This is my configuration:

lc_messages = 'en_US.UTF-8' # locale for system error message
# strings
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
lc_numeric = 'en_US.UTF-8' # locale for number formatting
lc_time = 'en_US.UTF-8' # locale for time formatting

I also noticed that when running under windows, postgresql returns negative money value as ($10.50). I still have to check how to force postgresql to always return negative values as -$value or some other consistent way regardless of the locale.

About the bug 1011001 failure, can you print the value of cs1 and cs2 so we can check what is the difference between them?

Thanks for your feedback and let's keep cleaning up those tests so they work ok on both Mono and ms.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment