build/tests hanging?

60 views
Skip to first unread message

Oskar Berggren

unread,
Nov 20, 2016, 3:15:27 PM11/20/16
to nhibernate-...@googlegroups.com
Is ShowBuildMenu -> Build release package hanging for anyone else?

/Oskar

Alexander Zaytsev

unread,
Nov 20, 2016, 4:18:47 PM11/20/16
to nhibernate-...@googlegroups.com
No
On Mon, 21 Nov 2016 at 9:15 AM, Oskar Berggren <oskar.b...@gmail.com> wrote:
Is ShowBuildMenu -> Build release package hanging for anyone else?

/Oskar

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oskar Berggren

unread,
Nov 20, 2016, 4:57:59 PM11/20/16
to nhibernate-...@googlegroups.com
Thanks for checking. Running in Visual Studio or using the NUnit GUI runner started from ShowBuildMenu did not seem to hang, so it's strange. They complete in about 6 minutes, while "build release package" took about 40 minutes, most of it in tests.


I've just found that there are multiple sql connections open, and the one trying to do something is blocked waiting for a lock held by another. Both (or all 10...) connections belong to the nunit-agent process.

Consider:

                      <test-case name="NHibernate.Test.CompositeId.ClassWithCompositeIdFixture.Hql" executed="True" result="Error" success="False" time="0.000" asserts="0">
                        <failure>
                          <message><![CDATA[NHibernate.Exceptions.GenericADOException : could not execute batch command.[SQL: SQL not available]
  ----> System.Data.SqlClient.SqlException : Violation of PRIMARY KEY constraint 'PK__class_w___AC41A41DF0C23C51'. Cannot insert duplicate key in object 'dbo.class_w_com_id'. The duplicate key value is (stringKey, 3, Aug 16 2003 12:00AM).

THEN:

                    <test-case name="NHibernate.Test.CompositeId.ClassWithCompositeIdFixture.TestSimpleCRUD" executed="True" result="Error" success="False" time="409.776" asserts="0">
                        <failure>
                          <message><![CDATA[NHibernate.Exceptions.GenericADOException : could not execute batch command.[SQL: SQL not available]
  ----> System.Data.SqlClient.SqlException : Violation of PRIMARY KEY constraint 'PK__class_w___AC41A41DF0C23C51'. Cannot insert duplicate key in object 'dbo.class_w_com_id'. The duplicate key value is (stringKey, 3, Aug 16 2003 12:00AM).


But the Hql() test case looks like:

        [Test]
        public void Hql()
        {
            // insert the new objects
            ISession s = OpenSession();
            ITransaction t = s.BeginTransaction();

            ClassWithCompositeId theClass = new ClassWithCompositeId(id);
            theClass.OneProperty = 5;

            ClassWithCompositeId theSecondClass = new ClassWithCompositeId(secondId);
            theSecondClass.OneProperty = 10;

            s.Save(theClass);
            s.Save(theSecondClass);

            // XXXXXXX

            t.Commit();
            s.Close();

            ISession s2 = OpenSession();

            IQuery hql = s2.CreateQuery("from ClassWithCompositeId as cwid where cwid.Id.KeyString = :keyString");

            hql.SetString("keyString", id.KeyString);

            IList results = hql.List();

            Assert.AreEqual(1, results.Count);

            s2.Close();
        }


So if there is a failure it may exit without closing transactions and session. Keeping the transaction open could certainly block the next test case. But of course, the base TestClass is supposed to detected and close any forgotten sessions, so it's still weird.


However, if I insert the following two lines at XXXXX above, I can get the same hack when running the tests in VS:
    s.Flush();
    throw new Exception("BUH!");


Was just about to post this when I found a cuprit. This will run and hang before the base TestCase class gets around to closing left-over sessions:

ClassWithCompositeIdFixture.OnTearDown()
        {
            using (ISession s = sessions.OpenSession())
            {
                s.Delete("from ClassWithCompositeId");
                s.Flush();
            }
        }



Still don't know why it's suddenly noticeable now. This isn't the only test case that suffers from this it appears, yet it's not a problem for the build server apparently. Just luck?

/Oskar

2016-11-20 21:18 GMT+00:00 Alexander Zaytsev <haz...@gmail.com>:
No
On Mon, 21 Nov 2016 at 9:15 AM, Oskar Berggren <oskar.b...@gmail.com> wrote:
Is ShowBuildMenu -> Build release package hanging for anyone else?

/Oskar

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

Oskar Berggren

unread,
Nov 20, 2016, 6:23:09 PM11/20/16
to nhibernate-...@googlegroups.com
I've adjusted a bunch of tests to use "using (ISession s = sessions.OpenSession())" and the problem went away. Still no idea why it suddenly appeared (the problematic tests have been around since forever).

/Oskar

No
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsubscri...@googlegroups.com.

Oskar Berggren

unread,
Nov 21, 2016, 4:28:50 AM11/21/16
to nhibernate-...@googlegroups.com
Alex (or anyone), does "Build Release Package" run successfully? I mean, no failing tests?

If I read this correctly, I get 3324 failing tests, despite having no failing tests when run in VS2010 (resharper runner):

[...]
     [exec]    Not fixed yet.
     [exec] 235) Ignored : NHibernate.Test.UtilityTest.TypeNameParserFixture.Par
seUnmatchedBracket
     [exec]    Not a big problem because the next type request will throw the ex
ception
     [exec]

BUILD FAILED - 0 non-fatal error(s), 6 warning(s)

External Program Failed: C:\Users\oskar.berggren\Documents\Projects\nhibernate-c
ore\Tools\NUnit\nunit-console-x86.exe (return code was 3324)

Total time: 177.5 seconds.


The nunit results file show:
<test-results name="C:\Users\oskar.berggren\Documents\Projects\nhibernate-core\build\NHibernate-4.1.0.CR1\bin\net-4.0\NHibernate.Test.dll" total="5087" errors="3308" failures="11" not-run="232" inconclusive="0" ignored="227" skipped="0" invalid="5" date="2016-11-21" time="09:57:10">

I'm not sure what the difference between errors and failures is, but 3308+11 plus the 5 invalid equals 3324 at least.


I do get a lot of these:
<test-case name="NHibernate.Test.Cascade.OneToOneCascadeDelete.Fk.Composite.DeleteOneToOneOrphansTestByCode.DeleteOneToOneOrphansTest.TestOrphanedWhileManaged" executed="True" result="Error" success="False" time="0.016" asserts="0">
                                    <failure>
                                      <message><![CDATA[System.TypeLoadException : Inheritance security rules violated while overriding member: 'Antlr.Runtime.RecognitionException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
TearDown : System.TypeLoadException : Inheritance security rules violated while overriding member: 'Antlr.Runtime.RecognitionException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]]></message>
                                      <stack-trace><![CDATA[at NHibernate.Hql.Ast.ANTLR.ErrorCounter..ctor()
at NHibernate.Hql.Ast.ANTLR.HqlParser..ctor(ITokenStream input, RecognizerSharedState state) in C:\Users\oskar.berggren\Documents\Projects\nhibernate-core\src\NHibernate\Hql\Ast\ANTLR\HqlParser.cs:line 90
at NHibernate.Hql.Ast.ANTLR.HqlParser..ctor(ITokenStream input) in C:\Users\oskar.berggren\Documents\Projects\nhibernate-core\src\NHibernate\Hql\Ast\ANTLR\Generated\HqlParser.cs:line 177


Antlr.Runtime.RecognitionException.GetObjectData does lack the SecurityCritical attribute. Hate it when different test runners give wildly different results.


/Oskar

Alexander Zaytsev

unread,
Nov 21, 2016, 5:39:42 AM11/21/16
to nhibernate-development
I think it uses "current test configuration" please check that your one is correct.

To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

Oskar Berggren

unread,
Nov 21, 2016, 5:58:51 AM11/21/16
to nhibernate-...@googlegroups.com
My current-test-configuration folder has:
<hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" >
    <session-factory name="NHibernate.Test">
        <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
        <property name="connection.connection_string">
            Server=(local);initial catalog=nhibernate;Integrated Security=SSPI
        </property>
        <property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
    </session-factory>
</hibernate-configuration>

Which looks correct, and I do see that it performs work in the expected database.


Don't you get these?

<failure>
                                      <message><![CDATA[System.TypeLoadException : Inheritance security rules violated while overriding member: 'Antlr.Runtime.RecognitionException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
TearDown : System.TypeLoadException : Inheritance security rules violated while overriding member: 'Antlr.Runtime.RecognitionException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]]></message>
                                      <stack-trace><![CDATA[at NHibernate.Hql.Ast.ANTLR.ErrorCounter..ctor()
at NHibernate.Hql.Ast.ANTLR.HqlParser..ctor(ITokenStream input, RecognizerSharedState state) in C:\Users\oskar.berggren\Documents\Projects\nhibernate-core\src\NHibernate\Hql\Ast\ANTLR\HqlParser.cs:line 90
at NHibernate.Hql.Ast.ANTLR.HqlParser..ctor(ITokenStream input) in C:\Users\oskar.berggren\Documents\Projects\nhibernate-core\src\NHibernate\Hql\Ast\ANTLR\Generated\HqlParser.cs:line 177
at NHibernate.Hql.Ast.ANTLR.HqlParseEngine.Parse() in C:\Users\oskar.berggren\Documents\Projects\nhibernate-core\src\NHibernate\Hql\Ast\ANTLR\QueryTranslatorImpl.cs:line 459


Alexander Zaytsev

unread,
Nov 21, 2016, 6:10:18 PM11/21/16
to nhibernate-...@googlegroups.com
It's the matter of "Release" configuration. Something wrong with il-repack and Antlr!?

Best Regards,
Alexander
No
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

Alexander Zaytsev

unread,
Nov 21, 2016, 7:29:06 PM11/21/16
to nhibernate-...@googlegroups.com
Fixed

Oskar Berggren

unread,
Nov 23, 2016, 2:14:05 PM11/23/16
to nhibernate-...@googlegroups.com
Thanks! Now it works.

I guess we really should have a release build on teamcity - at least one corresponding to the "default" build.



Fixed

No
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

Alexander Zaytsev

unread,
Nov 23, 2016, 8:15:03 PM11/23/16
to nhibernate-...@googlegroups.com
I've added the daily build equivalent of "build release package" to the TeamCity

Best Regards,
Alexander
Fixed

No
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-develo...@googlegroups.com.

Oskar Berggren

unread,
Nov 24, 2016, 12:03:39 PM11/24/16
to nhibernate-...@googlegroups.com
Great!

Fixed

No
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
You received this message because you are subscribed to the Google Groups "nhibernate-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhibernate-development+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages