UKGovLD / registry-core

Linked data registry - core application and example UI
https://github.com/UKGovLD/registry-core/wiki
Apache License 2.0
23 stars 9 forks source link

proxy test not passing #95

Closed eroux closed 7 years ago

eroux commented 7 years ago

One of the tests does not pass due to the test trying to access a non-existing file. Here is an extract of the surefire report (tell me if you want the whole file):

  <testcase name="testAll" classname="com.epimorphics.registry.webapi.TestAPI" time="2.655">
    <error message="File not found: /var/opt/ldregistry/proxy-registry.conf" type="org.apache.jena.shared.NotFoundException">org.apache.jena.shared.NotFoundException: File not found: /var/opt/ldregistry/proxy-registry.conf
        at org.apache.jena.util.FileManager.readWholeFileAsUTF8(FileManager.java:498)
        at com.epimorphics.registry.webapi.TestAPI.doForwardingTest(TestAPI.java:546)
        at com.epimorphics.registry.webapi.TestAPI.testAll(TestAPI.java:157)
</error>
der commented 7 years ago

Try again, the tests were assuming they were running in a suitably configured environment. Suppressed that test if that assumption is false.

eroux commented 7 years ago

Thanks, that did it! Now I have another failure in testLogAndReplay:

<testcase name="testLogAndReplay" classname="com.epimorphics.registry.webapi.TestReplay" time="2.358">
    <failure type="java.lang.AssertionError:">java.lang.AssertionError:
        at org.junit.Assert.fail(Assert.java:91)
        at org.junit.Assert.assertTrue(Assert.java:43)
        at org.junit.Assert.assertTrue(Assert.java:54)
        at com.epimorphics.registry.webapi.TestReplay.doReplay(TestReplay.java:107)
        at com.epimorphics.registry.webapi.TestReplay.performReplay(TestReplay.java:101)
        at com.epimorphics.registry.webapi.TestReplay.testLogAndReplay(TestReplay.java:71)
</failure>
    <system-out><![CDATA[06-12 12:56:35 INFO  Http11Protocol       :: Initializing ProtocolHandler ["http-bio-8070"]
06-12 12:56:35 INFO  StandardService      :: Starting service Tomcat
06-12 12:56:35 INFO  StandardEngine       :: Starting Servlet Engine: Apache Tomcat/7.0.26
06-12 12:56:35 INFO  ContextConfig        :: No global web.xml found
06-12 12:56:35 WARN  TDBStore             :: Opening in-memory database
06-12 12:56:35 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/root-register.ttl
06-12 12:56:35 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/registry.ttl
06-12 12:56:35 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/system-registers.ttl
06-12 12:56:35 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/prefixes-register.ttl
06-12 12:56:36 INFO  Registry             :: Installed bootstrap root register
06-12 12:56:36 INFO  Status               :: Setting default status lifecycle
06-12 12:56:36 INFO  Status               ::    reserved -> [submitted invalid ]
06-12 12:56:36 INFO  Status               ::    submitted -> [invalid experimental stable ]
06-12 12:56:36 INFO  Status               ::    invalid -> [invalid ]
06-12 12:56:36 INFO  Status               ::    experimental -> [invalid superseded retired stable ]
06-12 12:56:36 INFO  Status               ::    superseded -> [invalid ]
06-12 12:56:36 INFO  Status               ::    retired -> [invalid ]
06-12 12:56:36 INFO  Status               ::    stable -> [invalid superseded retired ]
06-12 12:56:36 WARN  Registry             :: No backup service configured
06-12 12:56:36 INFO  AppConfig            :: Loaded App myapp as the default app
06-12 12:56:36 INFO  Http11Protocol       :: Starting ProtocolHandler ["http-bio-8070"]
06-12 12:56:36 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:36 +0200] Read "http://location.data.gov.uk/?" 200
06-12 12:56:36 WARN  Command              :: Security is not configured, assuming test mode
06-12 12:56:36 INFO  Command              :: Created new sub-register: reg1
06-12 12:56:37 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:37 +0200] Register "http://location.data.gov.uk/?" -> [http://location.data.gov.uk/_reg1] 201
06-12 12:56:37 WARN  Command              :: Security is not configured, assuming test mode
06-12 12:56:37 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:37 +0200] Register "http://location.data.gov.uk/reg1?" -> [http://location.data.gov.uk/reg1/_red] 201
06-12 12:56:37 WARN  Command              :: Security is not configured, assuming test mode
06-12 12:56:37 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:37 +0200] StatusUpdate "http://location.data.gov.uk/_reg1?update=&status=experimental" 204
06-12 12:56:37 WARN  Command              :: Security is not configured, assuming test mode
06-12 12:56:37 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:37 +0200] RealDelete "http://location.data.gov.uk/reg1/_blue?real_delete=" 204
06-12 12:56:37 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:37 +0200] Read "http://location.data.gov.uk/reg1?status=any" 200
06-12 12:56:37 INFO  Http11Protocol       :: Pausing ProtocolHandler ["http-bio-8070"]
06-12 12:56:37 INFO  StandardService      :: Stopping service Tomcat
06-12 12:56:37 INFO  App                  :: Shut down myapp.registry
06-12 12:56:37 INFO  App                  :: Shut down myapp.messages
06-12 12:56:37 INFO  AppConfig            :: Shut down myapp
06-12 12:56:37 INFO  Http11Protocol       :: Stopping ProtocolHandler ["http-bio-8070"]
06-12 12:56:37 INFO  Http11Protocol       :: Destroying ProtocolHandler ["http-bio-8070"]
06-12 12:56:37 INFO  Http11Protocol       :: Initializing ProtocolHandler ["http-bio-8070"]
06-12 12:56:37 INFO  StandardService      :: Starting service Tomcat
06-12 12:56:37 INFO  StandardEngine       :: Starting Servlet Engine: Apache Tomcat/7.0.26
06-12 12:56:37 INFO  ContextConfig        :: No global web.xml found
06-12 12:56:37 WARN  TDBStore             :: Opening in-memory database
06-12 12:56:37 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/root-register.ttl
06-12 12:56:37 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/registry.ttl
06-12 12:56:37 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/system-registers.ttl
06-12 12:56:37 INFO  Registry             :: Loading bootstrap file /home/eroux/BUDA/softs/registry-core/src/test/webapp/WEB-INF/prefixes-register.ttl
06-12 12:56:37 INFO  Registry             :: Installed bootstrap root register
06-12 12:56:37 INFO  Status               :: Setting default status lifecycle
06-12 12:56:37 INFO  Status               ::    reserved -> [submitted invalid ]
06-12 12:56:37 INFO  Status               ::    submitted -> [invalid experimental stable ]
06-12 12:56:37 INFO  Status               ::    invalid -> [invalid ]
06-12 12:56:37 INFO  Status               ::    experimental -> [invalid superseded retired stable ]
06-12 12:56:37 INFO  Status               ::    superseded -> [invalid ]
06-12 12:56:37 INFO  Status               ::    retired -> [invalid ]
06-12 12:56:37 INFO  Status               ::    stable -> [invalid superseded retired ]
06-12 12:56:37 WARN  Registry             :: No backup service configured
06-12 12:56:37 INFO  AppConfig            :: Loaded App myapp as the default app
06-12 12:56:37 INFO  Http11Protocol       :: Starting ProtocolHandler ["http-bio-8070"]
06-12 12:56:37 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:37 +0200] Read "http://location.data.gov.uk/?" 200
06-12 12:56:37 INFO  Command              :: 127.0.0.1 [12/juin/2017:12:56:37 +0200] Read "http://location.data.gov.uk/reg1?status=any" 404
06-12 12:56:37 WARN  Replication          :: Security is not configured, assuming test mode
06-12 12:56:37 WARN  Command              :: Security is not configured, assuming test mode
06-12 12:56:37 INFO  Command              :: Log replay [12/juin/2017:12:56:37 +0200] StatusUpdate "http://location.data.gov.uk/reg1/_blue?update=&status=experimental" 404
06-12 12:56:37 INFO  Http11Protocol       :: Pausing ProtocolHandler ["http-bio-8070"]
06-12 12:56:37 INFO  StandardService      :: Stopping service Tomcat
06-12 12:56:37 INFO  App                  :: Shut down myapp.registry
06-12 12:56:37 INFO  App                  :: Shut down myapp.messages
06-12 12:56:37 INFO  AppConfig            :: Shut down myapp
06-12 12:56:37 INFO  Http11Protocol       :: Stopping ProtocolHandler ["http-bio-8070"]
06-12 12:56:37 INFO  Http11Protocol       :: Destroying ProtocolHandler ["http-bio-8070"]
]]></system-out>
  </testcase>
der commented 7 years ago

Hmm. I suspect there's a timing problem somewhere in that one (in the test, not the actual code being tested). I have seen the failure once or twice but never managed to repeat it. Does it fail consistently for you?

eroux commented 7 years ago

Oh indeed, the first time I tried it it failed, but I just retried twice and it succeeded, thanks! I let you close it if you think it's relevant, or leave it open if you think it needs fixing...

der commented 7 years ago

Thanks, closing this one, after all issue title is about a different test :) Will keep an eye open for repeats of the TestReplay failure.