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

JENKINS-61735 Get all environment variable #92

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@
<artifactId>ansicolor</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>pipeline-stage-step</artifactId>
<version>2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import hudson.EnvVars;
import hudson.Extension;
import hudson.console.ConsoleLogFilter;
import hudson.model.AbstractBuild;
Expand All @@ -16,14 +17,16 @@
public class LogstashConsoleLogFilter extends ConsoleLogFilter implements Serializable
{

private EnvVars envVars;
private static final Logger LOGGER = Logger.getLogger(LogstashConsoleLogFilter.class.getName());

private transient Run<?, ?> run;
public LogstashConsoleLogFilter() {}

public LogstashConsoleLogFilter(Run<?, ?> run)
public LogstashConsoleLogFilter(Run<?, ?> run, EnvVars envVars)
{
this.run = run;
this.envVars = envVars;
}
private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -62,7 +65,7 @@ public OutputStream decorateLogger(Run build, OutputStream logger) throws IOExce

LogstashWriter getLogStashWriter(Run<?, ?> build, OutputStream errorStream)
{
return new LogstashWriter(build, errorStream, null, build.getCharset());
return new LogstashWriter(build, errorStream, null, build.getCharset(), envVars);
}

private boolean isLogstashEnabled(Run<?, ?> build)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package jenkins.plugins.logstash;


import hudson.EnvVars;
import hudson.model.AbstractBuild;
import hudson.model.TaskListener;
import hudson.model.Run;
Expand Down Expand Up @@ -61,8 +62,14 @@ public class LogstashWriter {
private final LogstashIndexerDao dao;
private boolean connectionBroken;
private final Charset charset;
private final EnvVars envVars;

public LogstashWriter(Run<?, ?> run, OutputStream error, TaskListener listener, Charset charset) {
this(run, error, listener, charset, null);
}

public LogstashWriter(Run<?, ?> run, OutputStream error, TaskListener listener, Charset charset, EnvVars envVars) {
this.envVars = envVars;
this.errorStream = error != null ? error : System.err;
this.build = run;
this.listener = listener;
Expand Down Expand Up @@ -154,7 +161,7 @@ BuildData getBuildData() {
if (build instanceof AbstractBuild) {
return new BuildData((AbstractBuild<?, ?>) build, new Date(), listener);
} else {
return new BuildData(build, new Date(), listener);
return new BuildData(build, new Date(), listener, envVars);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package jenkins.plugins.logstash.persistence;

import hudson.EnvVars;
import hudson.model.Action;
import hudson.model.Environment;
import hudson.model.Executor;
Expand Down Expand Up @@ -212,20 +213,23 @@ public BuildData(AbstractBuild<?, ?> build, Date currentTime, TaskListener liste
}

// Pipeline project build
public BuildData(Run<?, ?> build, Date currentTime, TaskListener listener) {
public BuildData(Run<?, ?> build, Date currentTime, TaskListener listener, EnvVars envVars) {
initData(build, currentTime);

rootProjectName = projectName;
rootFullProjectName = fullProjectName;
rootProjectDisplayName = displayName;
rootBuildNum = buildNum;

try {
// TODO: sensitive variables are not filtered, c.f. https://stackoverflow.com/questions/30916085
buildVariables = build.getEnvironment(listener);
} catch (IOException | InterruptedException e) {
LOGGER.log(WARNING,"Unable to get environment for " + build.getDisplayName(),e);
buildVariables = new HashMap<>();
if (envVars != null) {
buildVariables = envVars;
} else {
try {
// TODO: sensitive variables are not filtered, c.f. https://stackoverflow.com/questions/30916085
buildVariables = build.getEnvironment(listener);
} catch (IOException | InterruptedException e) {
LOGGER.log(WARNING,"Unable to get environment for " + build.getDisplayName(),e);
buildVariables = new HashMap<>();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.jenkinsci.plugins.workflow.steps.StepExecution;
import org.kohsuke.stapler.DataBoundConstructor;

import hudson.EnvVars;
import hudson.Extension;
import hudson.console.ConsoleLogFilter;
import hudson.model.Run;
Expand Down Expand Up @@ -59,6 +60,7 @@ public boolean start() throws Exception {
context
.newBodyInvoker()
.withContext(createConsoleLogFilter(context))
.withContext(context.get(EnvVars.class))
.withCallback(BodyExecutionCallback.wrap(context))
.start();
return false;
Expand All @@ -68,7 +70,8 @@ private ConsoleLogFilter createConsoleLogFilter(StepContext context)
throws IOException, InterruptedException {
ConsoleLogFilter original = context.get(ConsoleLogFilter.class);
Run<?, ?> build = context.get(Run.class);
ConsoleLogFilter subsequent = new LogstashConsoleLogFilter(build);
EnvVars envVars = context.get(EnvVars.class);
ConsoleLogFilter subsequent = new LogstashConsoleLogFilter(build, envVars);
return BodyInvoker.mergeConsoleLogFilters(original, subsequent);
}

Expand Down
17 changes: 13 additions & 4 deletions src/test/java/jenkins/plugins/logstash/PipelineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.BuildWatcher;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;

import jenkins.plugins.logstash.configuration.MemoryIndexer;
Expand All @@ -38,20 +39,28 @@ public void setup() throws Exception
config.setEnabled(true);
}

@Issue("JENKINS-61735")
@Test
public void logstash() throws Exception
{
WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("logstash {\n" +
"currentBuild.result = 'SUCCESS'\n" +
"echo 'Message'\n" +
"}", true));
p.setDefinition(new CpsFlowDefinition(
"node('master') {\n" +
" stage('mystage') {\n" +
" logstash {\n" +
" currentBuild.result = 'SUCCESS'\n" +
" echo 'Message'\n" +
" }\n" +
" }\n" +
"}", true));
Comment on lines +48 to +55
Copy link

@mwinter69 mwinter69 Apr 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will only work then the logstash step is insside a node/stage. When you write
logstash { stage('s') { echo 'm' } }

Will it work as well?

Copy link
Author

@tgatinea tgatinea Apr 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I do:
p.setDefinition(new CpsFlowDefinition(
"node('master') {\n" +
" logstash {\n" +
" stage('mystage') {\n" +
" currentBuild.result = 'SUCCESS'\n" +
" echo 'Message'\n" +
" }\n" +
" }\n" +
"}", true));
Then you will have the NODE_NAME but not the STAGE_NAME.
In fact, it's normal to get the NODE_NAME as in this case the node is evaluated before the logstash{} while the STAGE_NAME is not yet evaluated, so it cannot be set.
But in fact, it's an expected behavior as we recover the envVars in the context of the evaluation of logstash{}.
In my use case (e.g. having the capacity to have at least STAGE_NAME + NODE_NAME in metadata associated to each line of log), I can deal with that as it is only a matter of putting the logstash{} statement at the right place.
And for a pipeline with multiple stages, I'll have to set a "logstash{}" statement inside each stages.
FYI, I've in mind another case where the pipeline fails at its very begining (e.g. Cannot recover the jenkinsfile from git. We have this issue frequently...), I guess that for the moment, I've no solution.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwinter69 I was thinking about your remark.
I've currently recovered the envVars from the context that is set in LogstashStep.java
I was wondering whether it was possible to recover the envVars from the context at each line of log level.
And maybe if it was then possible to setup globally the logstash for a pipeline, then it would cover all my use cases.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just implementing the possibility to enable globally with a TaskListenerDecorator. Not sure if there is a way to get to the corresponding flow node so one can extract from there (via the parents) the node and stage.
There is a completely other possibility to get the logs to ES by implementing a true pipeline logger (like in https://github.com/jenkinsci/pipeline-cloudwatch-logs-plugin). There it is possible to get the node and stage.
But this comes at a high price:

  • You need to also implement reading from ES as the logs are no longer stored in the file system (so how to handle rabbitmq, redis,...,)
  • performance is bad when writing directly to ES (might be necessary to use a buffer inbetween like fluentd). Haven't tested this but logstash plugin might have this bad performance impact as well

We have implemented this pipeline logger in our company, we might once publish this as open source, but it is still WIP. What we currently try to do is writing to ES and in parallel write to local Filesystem, so we don't need to read from ES.
Also our implemention is much more lightweigth in regarding the data we sent to ES (see https://issues.jenkins-ci.org/browse/JENKINS-54685) and uses a more straight forward data model

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwinter69 Thanks for your answer. Is it possible to share your implementation of enabling globally with a TaskListenerDecorator ?

Copy link
Author

@tgatinea tgatinea May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakub-bochenski Forget my question. You were talking about the parameter failBuild that can be set into logstashSend()
I'm going to check how to set this parameter with logstash{} statement

Copy link
Author

@tgatinea tgatinea May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakub-bochenski I have tried to reproduce my issue in a sandbox with the following pipeline:

pipeline {
    agent { label 'master' }
    stages {
        stage('Stage in parallel') {
            parallel {
                stage('My stage 1') {
                    steps {
                        logstash {
                            sh '''#!/bin/bash
                            for i in {1..10000}
                            do
                               echo "#1 Welcome $i times"
                            done
                            '''
                        }
                    }
                }
                stage('My stage 2') {
                    steps {
                        logstash {
                            sh '''#!/bin/bash
                            for i in {1..10000}
                            do
                               echo "#2 Welcome $i times"
                            done
                            '''
                        }
                    }
                }
            }
        }
    }
}

But after a while I get a lot of errors in the jenkins log :
``̀`
2020-05-19 11:51:53.185+0000 [id=12] WARNING o.j.p.w.log.FileLogStorage#maybeFlush: failed to flush /var/jenkins_home/jobs/afac/builds/1/log
java.io.IOException: Stream Closed
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:326)
at org.jenkinsci.plugins.workflow.log.DelayBufferedOutputStream$FlushControlledOutputStream.write(DelayBufferedOutputStream.java:125)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at java.io.FilterOutputStream.flush(FilterOutputStream.java:140)
at org.jenkinsci.plugins.workflow.log.FileLogStorage.maybeFlush(FileLogStorage.java:190)
at org.jenkinsci.plugins.workflow.log.FileLogStorage.overallLog(FileLogStorage.java:198)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.getLogText(WorkflowRun.java:1046)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
at org.kohsuke.stapler.MetaClass$2.doDispatch(MetaClass.java:219)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:456)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:280)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:878)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:676)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:248)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:88)
at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:114)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at org.jenkinsci.plugins.modernstatus.ModernStatusFilter.doFilter(ModernStatusFilter.java:52)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:153)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1604)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1300)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1215)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:500)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
at java.lang.Thread.run(Thread.java:748)

...

2020-05-19 11:52:02.119+0000 [id=1180] INFO o.j.p.w.s.concurrent.Timeout#lambda$ping$0: org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep [#1264]: checking /var/jenkins_home/workspace/afac on unresponsive for 10 sec
2020-05-19 11:52:02.126+0000 [id=1180] INFO o.j.p.w.s.concurrent.Timeout#lambda$ping$0: org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep [#1265]: checking /var/jenkins_home/workspace/afac on unresponsive for 10 sec
2020-05-19 11:52:07.120+0000 [id=1180] INFO o.j.p.w.s.concurrent.Timeout#lambda$ping$0: org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep [#1264]: checking /var/jenkins_home/workspace/afac on unresponsive for 15 sec
2020-05-19 11:52:07.126+0000 [id=1180] INFO o.j.p.w.s.concurrent.Timeout#lambda$ping$0: org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep [#1265]: checking /var/jenkins_home/workspace/afac on unresponsive for 15 sec
2020-05-19 11:52:12.121+0000 [id=1180] INFO o.j.p.w.s.concurrent.Timeout#lambda$ping$0: org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep [#1264]: checking /var/jenkins_home/workspace/afac on unresponsive for 20 sec
2020-05-19 11:52:12.126+0000 [id=1180] INFO o.j.p.w.s.concurrent.Timeout#lambda$ping$0: org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep [#1265]: checking /var/jenkins_home/workspace/afac on unresponsive for 20 sec




Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I don't quite follow
if it's a separate issue from this pull request, please file it in the JIRA tracker/GH issue with full description

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I will do that as in fact this issue is not related to my pull request

Copy link
Author

@tgatinea tgatinea May 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've written the JIRA issue https://issues.jenkins-ci.org/browse/JENKINS-62354 for that.
This is now the main issue that blocks me to use logstash plugin.

j.assertBuildStatusSuccess(p.scheduleBuild2(0).get());
List<JSONObject> dataLines = memoryDao.getOutput();
assertThat(dataLines.size(), equalTo(1));
JSONObject firstLine = dataLines.get(0);
JSONObject data = firstLine.getJSONObject("data");
assertThat(data.getString("result"),equalTo("SUCCESS"));
assertThat(data.getJSONObject("buildVariables").getString("STAGE_NAME"), equalTo("mystage"));
assertThat(data.getJSONObject("buildVariables").getString("NODE_NAME"), equalTo("master"));
}

@Test
Expand Down