Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE during rebind (when memento file empty, perhaps?) #1352

Open
aledsage opened this issue May 1, 2014 · 1 comment
Open

NPE during rebind (when memento file empty, perhaps?) #1352

aledsage opened this issue May 1, 2014 · 1 comment

Comments

@aledsage
Copy link
Member

aledsage commented May 1, 2014

The test FixedListMachineProvisioningLocationRebindTest.testRebindPreservesConfig() failed in buildhive:

https://buildhive.cloudbees.com/job/brooklyncentral/job/brooklyn/io.brooklyn$brooklyn-core/2150/testReport/junit/brooklyn.location.basic/FixedListMachineProvisioningLocationRebindTest/testRebindPreservesConfig/

Log output and exception is below. Two underlying problems:

  1. Need to guard against a file in the persistence dir giving back a deserialized null - e.g. if it's empty.
  2. The RebindTestUtils.waitForPersisted call in the test is supposed to wait for the file to be completely written so this should not have happened. If the file was being re-written then it will have been written to a temp location and then mv'ed across so we should never see an empty file.

2014-05-01 01:09:46,569 INFO TESTNG INVOKING CONFIGURATION: "Command line test" - @BeforeMethod brooklyn.location.basic.FixedListMachineProvisioningLocationRebindTest.setUp()
2014-05-01 01:09:46,579 INFO Memento-persister will use directory /tmp/1398906586570-0
2014-05-01 01:09:46,674 INFO Started application Application[hdhOqiH6]
2014-05-01 01:09:46,895 INFO TESTNG PASSED CONFIGURATION: "Command line test" - @BeforeMethod brooklyn.location.basic.FixedListMachineProvisioningLocationRebindTest.setUp() finished in 326 ms
2014-05-01 01:09:46,895 INFO TESTNG INVOKING: "Command line test" - brooklyn.location.basic.FixedListMachineProvisioningLocationRebindTest.testRebindPreservesConfig()
2014-05-01 01:09:46,918 INFO Rebinding app, using directory /tmp/1398906586570-0
2014-05-01 01:09:46,923 INFO Memento-persister will use directory /tmp/1398906586570-0
2014-05-01 01:09:46,930 INFO Loading memento from /tmp/1398906586570-0; 1 entities, 3 locations, 0 policies
2014-05-01 01:09:47,024 WARN Problem during rebind (rethrowing)
java.lang.NullPointerException: null
at brooklyn.entity.rebind.dto.BrooklynMementoImpl$Builder.location(BrooklynMementoImpl.java:60) ~[classes/:na]
2014-05-01 01:09:47,026 INFO TESTNG FAILED: "Command line test" - brooklyn.location.basic.FixedListMachineProvisioningLocationRebindTest.testRebindPreservesConfig() finished in 130 ms
java.lang.NullPointerException
at brooklyn.entity.rebind.dto.BrooklynMementoImpl$Builder.location(BrooklynMementoImpl.java:60)
at brooklyn.entity.rebind.persister.BrooklynMementoPersisterToMultiFile.loadMemento(BrooklynMementoPersisterToMultiFile.java:121)
at brooklyn.entity.rebind.RebindManagerImpl.rebind(RebindManagerImpl.java:213)
at brooklyn.entity.rebind.RebindTestUtils.rebind(RebindTestUtils.java:152)
at brooklyn.location.basic.FixedListMachineProvisioningLocationRebindTest.rebind(FixedListMachineProvisioningLocationRebindTest.java:97)
at brooklyn.location.basic.FixedListMachineProvisioningLocationRebindTest.testRebindPreservesConfig(FixedListMachineProvisioningLocationRebindTest.java:61)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:77)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:189)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:105)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:117)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:158)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:86)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

@aledsage
Copy link
Member Author

aledsage commented May 1, 2014

Fix for NPE (point 1 above) in #1346

@grkvlt grkvlt added bug labels May 2, 2014
@grkvlt grkvlt added this to the v 0.7.0 milestone May 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants