Build failed in Jenkins: brooklyn-server-master-docker #70

2018-04-20 Thread Apache Jenkins Server
See 


--
[...truncated 8.78 KB...]
ERROR: Failed to clean the workspace
java.io.IOException: Unable to delete 
' Tried 3 
times (of a maximum of 3) waiting 0.1 sec between attempts.
at hudson.Util.deleteContentsRecursive(Util.java:230)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:555)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.AccessDeniedException: 

at 
sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at 
sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
at 
sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at hudson.Util.tryOnceDeleteFile(Util.java:290)
at hudson.Util.tryOnceDeleteRecursive(Util.java:370)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.tryOnceDeleteRecursive(Util.java:369)
at hudson.Util.tryOnceDeleteContentsRecursive(Util.java:389)
at hudson.Util.deleteContentsRecursive(Util.java:225)
... 11 more
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Failed to delete workspace
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:558)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to 
ubuntu-4
at 
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
at hudson.remoting.Channel.call(Channel.java:908)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor1247.invoke(Unknown 
Source)
at 

[GitHub] brooklyn-server issue #957: SshCommandSensor.testDslWithSshSensor: convert t...

2018-04-20 Thread nakomis
Github user nakomis commented on the issue:

https://github.com/apache/brooklyn-server/pull/957
  
LGTM


---


Build failed in Jenkins: brooklyn-master-build-docker #373

2018-04-20 Thread Apache Jenkins Server
See 


--
Started by user richard
[EnvInject] - Loading node environment variables.
Building remotely on H24 (ubuntu xenial) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/brooklyn.git # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from 
https://git-wip-us.apache.org/repos/asf/brooklyn.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1724)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: hudson.plugins.git.GitException: Command "git config 
remote.origin.url https://git-wip-us.apache.org/repos/asf/brooklyn.git; 
returned status code 4:
stdout: 
stderr: error: failed to write new configuration file 


at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1243)
at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:160)
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:922)
at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:896)
at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:853)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to 
H24
at 
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
at hudson.remoting.Channel.call(Channel.java:908)
at 
hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:281)
at com.sun.proxy.$Proxy110.setRemoteUrl(Unknown Source)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl.setRemoteUrl(RemoteGitImpl.java:295)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:850)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
at hudson.scm.SCM.checkout(SCM.java:495)
at 
hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at 
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1724)
at 

Build failed in Jenkins: brooklyn-master-build-docker #372

2018-04-20 Thread Apache Jenkins Server
See 


--
Started by upstream project "brooklyn-server-master-docker" build number 71
originally caused by:
 Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H24 (ubuntu xenial) in workspace 

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url 
 > https://git-wip-us.apache.org/repos/asf/brooklyn.git # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from 
https://git-wip-us.apache.org/repos/asf/brooklyn.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1724)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: hudson.plugins.git.GitException: Command "git config 
remote.origin.url https://git-wip-us.apache.org/repos/asf/brooklyn.git; 
returned status code 4:
stdout: 
stderr: error: failed to write new configuration file 


at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609)
at 
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1243)
at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:160)
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:922)
at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:896)
at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:853)
at hudson.remoting.UserRequest.perform(UserRequest.java:207)
at hudson.remoting.UserRequest.perform(UserRequest.java:53)
at hudson.remoting.Request$2.run(Request.java:358)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to 
H24
at 
hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1693)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:310)
at hudson.remoting.Channel.call(Channel.java:908)
at 
hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:281)
at com.sun.proxy.$Proxy110.setRemoteUrl(Unknown Source)
at 
org.jenkinsci.plugins.gitclient.RemoteGitImpl.setRemoteUrl(RemoteGitImpl.java:295)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:850)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160)
at hudson.scm.SCM.checkout(SCM.java:495)
at 
hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at 
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)

[GitHub] brooklyn-server pull request #958: Fix non-deterministic EffectorResourceTes...

2018-04-20 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/958


---


[GitHub] brooklyn-server pull request #958: Fix non-deterministic EffectorResourceTes...

2018-04-20 Thread aledsage
GitHub user aledsage opened a pull request:

https://github.com/apache/brooklyn-server/pull/958

Fix non-deterministic EffectorResourceTest

e.g. this failed in 
https://builds.apache.org/view/B/view/Brooklyn/job/brooklyn-server-master-docker/69/

```
Regression

org.apache.brooklyn.rest.resources.EffectorResourceTest.testInvokeEffectorWithTimeoutTimesOut

Error Message
responseMap={id=TfFAYVbX, displayName=sleepEffector, description=Invoking 
effector sleepEffector on TestEntity:et9d with parameters {duration=5m}, 
entityId=et9dfmhgbc, entityDisplayName=TestEntity:et9d, tags=[EFFECTOR, 
{type=org.apache.brooklyn.api.mgmt.ManagementContext}, 
{wrappingType=contextEntity, 
entity={type=org.apache.brooklyn.api.entity.Entity, id=et9dfmhgbc}}, 
{wrappingType=targetEntity, entity={type=org.apache.brooklyn.api.entity.Entity, 
id=et9dfmhgbc}}, {entityId=et9dfmhgbc, effectorName=sleepEffector}], 
submitTimeUtc=1.524143241939E12, startTimeUtc=1.524143241939E12, 
endTimeUtc=null, currentStatus=In progress, result=null, isError=false, 
isCancelled=false, children=[], submittedByTask=null, 
detailedStatus=Task[sleepEffector]@TfFAYVbX  In progress (RUNNABLE) At: 
org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.tryCoerceInternal(TypeCoercerExtensible.java:189)
 
org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.tryCoerce(TypeCoercerExtensibl
 e.java:112) 
org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.coerce(TypeCoercerExtensible.java:102)
 
org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.coerce(TypeCoercerExtensible.java:98)
 
org.apache.brooklyn.util.core.flags.TypeCoercions.coerce(TypeCoercions.java:81) 

org.apache.brooklyn.core.mgmt.internal.EffectorUtils.prepareArgsForEffectorFromMap(EffectorUtils.java:167)
 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils.prepareArgsForEffector(EffectorUtils.java:75)
 
org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodLocal(AbstractManagementContext.java:324)
 
org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodSync(AbstractManagementContext.java:366)
 
org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:274)
 
org.apache.brooklyn.core.effector.MethodEffector.call(MethodEffector.java:153)  
   org.apache.brooklyn.core.e
 ffector.AbstractEffector.call(AbstractEffector.java:61) 
org.apache.brooklyn.core.effector.AbstractEffector$1$1.call(AbstractEffector.java:79)
 
org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:364)
 
org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:565),
 streams={}, links={self=/activities/TfFAYVbX, 
children=/activities/TfFAYVbX/children, 
entity=/applications/gkff4d6jt1/entities/et9dfmhgbc}} expected [true] but found 
[false]
Stacktrace
  java.lang.AssertionError: responseMap={id=TfFAYVbX, 
displayName=sleepEffector, description=Invoking effector sleepEffector on 
TestEntity:et9d with parameters {duration=5m}, entityId=et9dfmhgbc, 
entityDisplayName=TestEntity:et9d, tags=[EFFECTOR, 
{type=org.apache.brooklyn.api.mgmt.ManagementContext}, 
{wrappingType=contextEntity, 
entity={type=org.apache.brooklyn.api.entity.Entity, id=et9dfmhgbc}}, 
{wrappingType=targetEntity, entity={type=org.apache.brooklyn.api.entity.Entity, 
id=et9dfmhgbc}}, {entityId=et9dfmhgbc, effectorName=sleepEffector}], 
submitTimeUtc=1.524143241939E12, startTimeUtc=1.524143241939E12, 
endTimeUtc=null, currentStatus=In progress, result=null, isError=false, 
isCancelled=false, children=[], submittedByTask=null, 
detailedStatus=Task[sleepEffector]@TfFAYVbX

In progress (RUNNABLE)
At: 
org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.tryCoerceInternal(TypeCoercerExtensible.java:189)

org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.tryCoerce(TypeCoercerExtensible.java:112)

org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.coerce(TypeCoercerExtensible.java:102)

org.apache.brooklyn.util.javalang.coerce.TypeCoercerExtensible.coerce(TypeCoercerExtensible.java:98)

org.apache.brooklyn.util.core.flags.TypeCoercions.coerce(TypeCoercions.java:81)

org.apache.brooklyn.core.mgmt.internal.EffectorUtils.prepareArgsForEffectorFromMap(EffectorUtils.java:167)

org.apache.brooklyn.core.mgmt.internal.EffectorUtils.prepareArgsForEffector(EffectorUtils.java:75)

org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodLocal(AbstractManagementContext.java:324)

org.apache.brooklyn.core.mgmt.internal.AbstractManagementContext.invokeEffectorMethodSync(AbstractManagementContext.java:366)

org.apache.brooklyn.core.mgmt.internal.EffectorUtils.invokeMethodEffector(EffectorUtils.java:274)

[GitHub] brooklyn-server pull request #957: SshCommandSensor.testDslWithSshSensor: co...

2018-04-20 Thread aledsage
GitHub user aledsage opened a pull request:

https://github.com/apache/brooklyn-server/pull/957

SshCommandSensor.testDslWithSshSensor: convert to non-integration

See my comments in PR #953 

This now uses the `RecordingSshTool` to execute the ssh command sensor, so 
the test is quicker. If you run it 100 times, the first time still takes 2 
seconds (presumably due to classloading etc), and then it takes about 200ms per 
test after that.

Also fixes the final assertion, that it is the `newValue` in the sensor.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/aledsage/brooklyn-server pr953-addendum

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-server/pull/957.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #957


commit 628f383030538d2810802e6df190a9cd898fc473
Author: Aled Sage 
Date:   2018-04-20T09:50:22Z

SshCommandSensor.testDslWithSshSensor: convert to non-integration




---


[GitHub] brooklyn-server pull request #953: Defers reading of config in SshCommandSen...

2018-04-20 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/953#discussion_r183000496
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/sensor/ssh/SshCommandSensor.java ---
@@ -105,6 +97,7 @@ public void apply(final EntityLocal entity) {
 Map env = 
MutableMap.copyOf(entity.getConfig(BrooklynConfigKeys.SHELL_ENVIRONMENT));
 
 // Add the shell environment entries from our configuration
+Map sensorEnv = 
params.get(SENSOR_SHELL_ENVIRONMENT);
--- End diff --

Ignore this comment; later in the code it calls 
`Tasks.resolveDeepValue(env, ...)`


---


Jenkins build is back to normal : brooklyn-master-build-docker #371

2018-04-20 Thread Apache Jenkins Server
See 




[GitHub] brooklyn-server pull request #953: Defers reading of config in SshCommandSen...

2018-04-20 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/953#discussion_r182982642
  
--- Diff: 
camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/SshCommandSensorYamlTest.java
 ---
@@ -110,7 +110,46 @@ public void testSupressingDuplicates() throws 
Exception {
 listener.assertEventCount(1);
 }});
 }
-
+
+// "Integration" because takes a couple of seconds
--- End diff --

I wonder why it takes a couple of seconds - it shouldn't be doing any real 
ssh (because it has a `RecordingsshTool` instead).


---


[GitHub] brooklyn-server pull request #953: Defers reading of config in SshCommandSen...

2018-04-20 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/953#discussion_r182982839
  
--- Diff: 
camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/SshCommandSensorYamlTest.java
 ---
@@ -110,7 +110,46 @@ public void testSupressingDuplicates() throws 
Exception {
 listener.assertEventCount(1);
 }});
 }
-
+
+// "Integration" because takes a couple of seconds
+@Test(groups="Integration")
+public void testDslWithSshSensor() throws Exception {
+AttributeSensor mySensor = 
Sensors.newStringSensor("mySensor");
+AttributeSensor sourceSensor = 
Sensors.newStringSensor("sourceSensor");
+
+Entity app = createAndStartApplication(
+"location:",
+"  localhost",
+"services:",
+"- type: " + VanillaSoftwareProcess.class.getName(),
+"  brooklyn.config:",
+"onbox.base.dir.skipResolution: true",
+"checkRunning.command: true",
+"  brooklyn.initializers:",
+"  - type: org.apache.brooklyn.core.sensor.StaticSensor",
+"brooklyn.config:",
+"  name: " + sourceSensor.getName(),
+"  sensorType: string",
+"  static.value: someValue",
+"  - type: 
org.apache.brooklyn.core.sensor.ssh.SshCommandSensor",
+"brooklyn.config:",
+"  name: " + mySensor.getName(),
+"  command: ",
+"$brooklyn:formatString:",
+"- echo %s",
+"- $brooklyn:attributeWhenReady(\"sourceSensor\")",
+"  suppressDuplicates: true",
+"  period: 10ms",
+"  onlyIfServiceUp: false");
+waitForApplicationTasks(app);
+
+VanillaSoftwareProcess entity = (VanillaSoftwareProcess) 
Iterables.getOnlyElement(app.getChildren());
+EntityAsserts.assertAttributeEqualsEventually(entity, mySensor, 
"someValue");
+
+entity.sensors().set(sourceSensor, "newValue");
+EntityAsserts.assertAttributeEqualsEventually(entity, mySensor, 
"someValue");
--- End diff --

Should this not assert it equals `newValue`?


---


[GitHub] brooklyn-server pull request #953: Defers reading of config in SshCommandSen...

2018-04-20 Thread aledsage
Github user aledsage commented on a diff in the pull request:

https://github.com/apache/brooklyn-server/pull/953#discussion_r182983127
  
--- Diff: 
core/src/main/java/org/apache/brooklyn/core/sensor/ssh/SshCommandSensor.java ---
@@ -105,6 +97,7 @@ public void apply(final EntityLocal entity) {
 Map env = 
MutableMap.copyOf(entity.getConfig(BrooklynConfigKeys.SHELL_ENVIRONMENT));
 
 // Add the shell environment entries from our configuration
+Map sensorEnv = 
params.get(SENSOR_SHELL_ENVIRONMENT);
--- End diff --

We should probably also do `EntityInitializers.resolve` when retrieving the 
env.


---