Sakai 12.3 build failure on SiteStats

119 views
Skip to first unread message

Norman Danner

unread,
Aug 15, 2018, 5:20:00 PM8/15/18
to saka...@apereo.org
I am trying to build Sakai 12.3 from source. I have followed the Sakai
12 Install Guide. The build fails tests on the SiteStats
Implementation, and the test that appears to fail is StatsManagerTest.
Here is the contents of
sitestats/sitestats-impl/target/surefire-reports/
org.sakaiproject.sitestats.test.StatsManagerTest.txt

-------------------------------------------------------------------------------
Test set: org.sakaiproject.sitestats.test.StatsManagerTest
-------------------------------------------------------------------------------
Tests run: 10, Failures: 4, Errors: 0, Skipped: 1, Time elapsed: 5.323 sec <<<
FAILURE! - in org.sakaiproject.sitestats.test.StatsManagerTest
testResourceStats(org.sakaiproject.sitestats.test.StatsManagerTest) Time
elapsed: 0.169 sec <<< FAILURE!
java.lang.AssertionError: expected:<2> but was:<0>
at
org.sakaiproject.sitestats.test.StatsManagerTest.testResourceStats(StatsManagerTest.java:
1095)

testUsersWithVisits(org.sakaiproject.sitestats.test.StatsManagerTest) Time
elapsed: 0.016 sec <<< FAILURE!
java.lang.AssertionError: expected:<[user-a]> but was:<[]>
at
org.sakaiproject.sitestats.test.StatsManagerTest.testUsersWithVisits(StatsManagerTest.java:
463)

testSummaryMethods(org.sakaiproject.sitestats.test.StatsManagerTest) Time
elapsed: 0.043 sec <<< FAILURE!
java.lang.AssertionError: expected:<9> but was:<0>
at
org.sakaiproject.sitestats.test.StatsManagerTest.testSummaryMethods(StatsManagerTest.java:
640)

testResourceInfo(org.sakaiproject.sitestats.test.StatsManagerTest) Time
elapsed: 0.135 sec <<< FAILURE!
java.lang.AssertionError: expected:<1> but was:<0>
at
org.sakaiproject.sitestats.test.StatsManagerTest.testResourceInfo(StatsManagerTest.java:
555)

A possibly relevant fact is that
sitestats/sitestats-impl/target/surefire-reports/
org.sakaiproject.sitestats.test.StatsManagerTest-outpt.txt
has the following line:

16:51:36,282 WARN DefaultListableBeanFactory:1524 - Bean creation exception
on non-lazy FactoryBean type check:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.sakaiproject.sitestats.test.DB' defined in class path resource
[test-classes.xml]: Cannot resolve reference to bean
'org.sakaiproject.sitestats.test.DB.target' while setting bean property
'target'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.sakaiproject.sitestats.test.DB.target' defined in class path
resource [test-classes.xml]: Cannot resolve reference to bean
'org.sakaiproject.sitestats.SiteStatsSessionFactory' while setting bean
property 'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error
creating bean with name 'org.sakaiproject.sitestats.SiteStatsSessionFactory':
Requested bean is currently in creation: Is there an unresolvable circular
reference?

Does anyone have any ideas as to what might be going on?

- Norman Danner

--
Norman Danner - nda...@wesleyan.edu - http://ndanner.web.wesleyan.edu
Department of Mathematics and Computer Science - Wesleyan University

Thach Le

unread,
Aug 15, 2018, 8:50:25 PM8/15/18
to Norman Danner, saka...@apereo.org

Dear Norman,

 

For Windows, I’m using this script to build:

---

@ECHO OFF

SET JAVA_OPTS='-server -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=512m -XX:NewSize=192m -XX:MaxNewSize=384m -Djava.awt.headless=true -Dhttp.agent=Sakai -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false -Dsun.lang.ClassLoader.allowArraySyntax=true'

 

REM Should use the absolute path for folder release

SET TOMCAT_HOME=D:\jPackages\sakai12.3-bin

 

CALL mvn package sakai:deploy -Dmaven.tomcat.home=%TOMCAT_HOME% -Dmaven.test.skip=true

---

Thach N. Le, CS.MSc,
Sakai Senior Developer/Team Leader
Homepage: http://myworkspace.vn

--

You received this message because you are subscribed to the Google Groups "Sakai Development" group.

To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.

To post to this group, send email to saka...@apereo.org.

Visit this group at https://groups.google.com/a/apereo.org/group/sakai-dev/.

 

Earle Nietzel

unread,
Aug 16, 2018, 9:26:37 AM8/16/18
to Thach Le, Norman Danner, saka...@apereo.org
Hi Norman,

Do you get those failures every time you compile? SiteStats tests have been known to fail from time to time.

Norman Danner

unread,
Aug 16, 2018, 11:06:03 AM8/16/18
to Earle Nietzel, Thach Le, saka...@apereo.org
I tried to build twice, both times with

$ mvn clean install sakai:deploy -Dmaven.tomcat.home=/opt/sakai-12.3 -
Dsakai.home=/opt/sakai-12.3/sakai -Djava.net.preferIPv4Stack=true

I assume the clean target forces a complete re-build, so ought to have
cleared out any transient problems.

I also built again this morning, same result. I tried building with the
-e flag to maven, but got no additional useful information.

I should have mentioned that I am building on Linux (Debian 9), and:

$ javac -version
javac 1.8.0_102

$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5;
2015-11-10T11:41:47-05:00)
Maven home: /opt/apache-maven-3.3.9
Java version: 1.8.0_102, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk-8-oracle-x64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.9.0-7-amd64", arch: "amd64", family: "unix"

- Norman

On Thursday, August 16, 2018 9:26:24 AM EDT Earle Nietzel wrote:
> Hi Norman,
>
> Do you get those failures every time you compile? SiteStats tests have been
> known to fail from time to time.
>
> On Wed, Aug 15, 2018 at 8:50 PM Thach Le <thach...@gmail.com> wrote:
> > Dear Norman,
> >
> >
> >
> > For Windows, I’m using this script to build:
> >
> > ---
> >
> > @ECHO OFF
> >
> > SET JAVA_OPTS='-server -Xms512m -Xmx1024m -XX:PermSize=128m
> > -XX:MaxPermSize=512m -XX:NewSize=192m -XX:MaxNewSize=384m
> > -Djava.awt.headless=true -Dhttp.agent=Sakai
> > -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
> > -Dsun.lang.ClassLoader.allowArraySyntax=true'
> >
> >
> >
> > REM Should use the absolute path for folder release
> >
> > SET TOMCAT_HOME=D:\jPackages\sakai12.3-bin
> >
> >
> >
> > CALL mvn package sakai:deploy -Dmaven.tomcat.home=%TOMCAT_HOME%
> > -Dmaven.test.skip=true
> >
> > ---
> >
> > *Thach N. Le, CS.MSc,*
> > Sakai Senior Developer/Team Leader
> > Homepage: http://myworkspace.vn
> >
> >
> >
> > *From: *Norman Danner <nda...@wesleyan.edu>
> > *Sent: *Thursday, August 16, 2018 4:20 AM
> > *To: *saka...@apereo.org
> > *Subject: *[sakai-dev] Sakai 12.3 build failure on SiteStats

Earle Nietzel

unread,
Aug 16, 2018, 3:52:27 PM8/16/18
to Norman Danner, Thach Le, saka...@apereo.org
Thanks for the info, for now I would suggest skipping those tests in SiteStats...

mvn clean install -D maven.test.skip=true

Norman Danner

unread,
Aug 17, 2018, 10:34:24 AM8/17/18
to Earle Nietzel, Thach Le, saka...@apereo.org
Dear Earle,

Thanks for your help. Skipping all the unit tests certainly results in
a successful build.

So when is it safe to deploy Sakai when it only builds by not doing the
unit tests? Especially when one knows that it fails certain unit tests?

You mentioned that SiteStats tests have been known to fail from time to
time; do you know what the source of the occasional failure is?

- Norman
> <mailto:nda...@wesleyan.edu>>
> > > *Sent: *Thursday, August 16, 2018 4:20 AM
> > > *To: *saka...@apereo.org <mailto:saka...@apereo.org>
> <mailto:nda...@wesleyan.edu> - http://ndanner.web.wesleyan.edu
> > >
> > > Department of Mathematics and Computer Science  -  Wesleyan
> University
> > >
> > >
> > >
> > > --
> > >
> > > You received this message because you are subscribed to the
> Google Groups
> > > "Sakai Development" group.
> > >
> > > To unsubscribe from this group and stop receiving emails from
> it, send an
> > > email to sakai-dev+...@apereo.org
> <mailto:sakai-dev%2Bunsu...@apereo.org>.
> > >
> > > To post to this group, send email to saka...@apereo.org
> <mailto:saka...@apereo.org>.
> > >
> > > Visit this group at
> > > https://groups.google.com/a/apereo.org/group/sakai-dev/.
> > >
> > >
> > >
> > > --
> > > You received this message because you are subscribed to the
> Google Groups
> > > "Sakai Development" group.
> > > To unsubscribe from this group and stop receiving emails from
> it, send an
> > > email to sakai-dev+...@apereo.org
> <mailto:sakai-dev%2Bunsu...@apereo.org>.
> > > To post to this group, send email to saka...@apereo.org
> <mailto:saka...@apereo.org>.
> > > Visit this group at
> > > https://groups.google.com/a/apereo.org/group/sakai-dev/.
>
>
> --
> Norman Danner - nda...@wesleyan.edu <mailto:nda...@wesleyan.edu> -

Earle Nietzel

unread,
Aug 17, 2018, 11:23:17 AM8/17/18
to Norman Danner, Thach Le, saka...@apereo.org
For every pull request Travis will compile and run tests.

Some unit tests in SiteStats have been known to fail intermittently, these tests are failing due to a threading issue in SiteStats that causes a race condition during unit tests.

Austin

unread,
Jun 1, 2020, 2:57:44 PM6/1/20
to Earle Nietzel, Norman Danner, Thach Le, saka...@apereo.org
Hello Sakai-Devs,

Sorry to bug you all here.  But I'm running into this issue with Sakai 19.  I added a comment to SAK-39989, but haven't heard any replies there yet.  We use Jenkins for builds and the weird thing is that I have two jobs that build 19.4, and the original one still compiles fine. But the new one I set up to build/deploy to a new server always fails on these tests.  I even tried copying the original job's maven repository to the new job's workspace, but it still fails.  SAK-39989 says that it's fixed for 21.x, Is there any chance that it'll be merged to 19?  Or.. that patch looks complicated as it's a pretty big rewrite of the sitestats tests... is there any way to fix this particular race condition with a smaller patch?

To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To post to this group, send email to saka...@apereo.org.

Brian Jones

unread,
Jun 1, 2020, 3:15:47 PM6/1/20
to saka...@apereo.org
This doesn't resolve the issue, but in my experience the sitestats
tests are flaky at best. In some environments they pass, in some
environments they don't. Further mystifying, in some environments they
pass sometimes, and fail other times.

I remember Earle put in a PR recently to "modernize" sitestats tests.
Maybe that will help.

--
Brian Jones
Programmer/Analyst
Western Technology Services
Support Services Building, Suite 4300
Western University
(519) 661-2111 x86969
bjon...@uwo.ca

On Mon, 2020-06-01 at 08:57 -1000, Austin wrote:
> Hello Sakai-Devs,
>
> Sorry to bug you all here. But I'm running into this issue with
> Sakai 19.
> I added a comment
> <
> https://jira.sakaiproject.org/browse/SAK-39989?focusedCommentId=249367&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-249367
> >
> to SAK-39989 <https://jira.sakaiproject.org/browse/SAK-39989>;, but
> haven't
> heard any replies there yet. We use Jenkins for builds and the weird
> thing
> is that I have two jobs that build 19.4, and the original one still
> compiles fine. But the new one I set up to build/deploy to a new
> server
> *always* fails on these tests. I even tried copying the original
> > > est) Time

Austin

unread,
Jun 1, 2020, 3:33:41 PM6/1/20
to saka...@apereo.org
"I remember Earle put in a PR recently to "modernize" sitestats tests."

Yes, I saw that commit.  it was for SAK-39989.  There are quite a bit of differences between 19 and 21, so the patch from that JIRA doesn't apply.

Earle Nietzel

unread,
Jun 1, 2020, 4:29:48 PM6/1/20
to Austin, saka...@apereo.org
Austin,

I would just disable the test that is failing.

That patch will likely never be merged back because of the extent of the changes.

-earle


Austin

unread,
Jun 1, 2020, 4:46:08 PM6/1/20
to Earle Nietzel, saka...@apereo.org
Ok, thanks

Austin

unread,
Jun 1, 2020, 6:44:42 PM6/1/20
to Earle Nietzel, saka...@apereo.org
I tried excluding those test by running maven with

-DfailIfNoTests=false -Dtest="!StatsManagerTest#testResourceInfo+testResourceStats+testSummaryMethods+testUsersWithVisits"

but for some reason that causes an Assignments tool test to fail.  Also, if I run maven from only the sitestats folder, adding the above options then causes EventAggregatorTestPerf test to fail.  The only way i've been able to get it to compile and run is to add the @Ignore annotation to the specific failing tests.  That's ok, but it would be cooler if I could use the maven options above so I can script my build to use them depending on the environment (e.g. if that env. is known to fail on those tests).  plus, I'll have to remember to remove that hack once we upgrade to 21, which could be a couple of years from now.
Reply all
Reply to author
Forward
0 new messages