[JIRA] (JENKINS-59455) CheckFilterTest failing on environment.txt

22 views
Skip to first unread message

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 19, 2019, 11:10:03 PM9/19/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ created an issue
 
Jenkins / Bug JENKINS-59455
CheckFilterTest failing on environment.txt
Issue Type: Bug Bug
Assignee: Emilio Escobar
Components: support-core-plugin
Created: 2019-09-20 03:09
Environment: support-core
Priority: Major Major
Reporter: Allan BURDAJEWICZ

The CheckFilterTest is failing with the following issues:

=== Starting checkFilterTest(com.cloudbees.jenkins.support.CheckFilterTest)
   0.067 [id=14]	INFO	o.jvnet.hudson.test.WarExploder#explode: Picking up existing exploded jenkins.war at /Users/allan/Projects/dohbedoh/jenkins-plugins/support-core-plugin/target/jenkins-for-test
   0.388 [id=14]	INFO	o.jvnet.hudson.test.JenkinsRule#createWebServer: Running on http://localhost:54708/jenkins/
   1.934 [id=24]	INFO	jenkins.InitReactorRunner$1#onAttained: Started initialization
   2.377 [id=35]	WARNING	hudson.ClassicPluginStrategy#createClassJarFromWebInfClasses: Created /var/folders/m7/lghwdpdx70d6454dsp825bxc0000gn/T/jenkins2715125141041055036/async-http-client/WEB-INF/lib/classes.jar; update plugin to a version created with a newer harness
   3.017 [id=37]	INFO	jenkins.InitReactorRunner$1#onAttained: Listed all plugins
   5.225 [id=30]	INFO	jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
   5.245 [id=31]	INFO	jenkins.InitReactorRunner$1#onAttained: Started all plugins
   5.248 [id=27]	INFO	jenkins.InitReactorRunner$1#onAttained: Augmented all extensions
   6.204 [id=26]	INFO	jenkins.InitReactorRunner$1#onAttained: Loaded all jobs
   6.417 [id=22]	INFO	jenkins.InitReactorRunner$1#onAttained: Completed initialization
   6.436 [id=52]	INFO	hudson.UDPBroadcastThread#run: Cannot listen to UDP port 33,848, skipping: java.net.SocketException: Can't assign requested address
   8.946 [id=54]	INFO	o.j.h.test.SimpleCommandLauncher#launch: agent launched for slave0
  14.563 [id=14]	INFO	jenkins.model.Jenkins#cleanUp: Stopping Jenkins
  14.801 [id=14]	INFO	jenkins.model.Jenkins#cleanUp: Jenkins stopped

java.lang.AssertionError: The file 'nodes/master/environment.txt' should have the word 'user_molecular_volunteer'. File content:

nodes/master/environment.txt and nodes/slave/*/environment.txt are supposed have the word path filtered but they don't. The issue look transient though as the test is sometimes passing in jenkins.io, sometimes no:

On my local machine OSX, this test always fails with the error above. On other colleague in Linux (Ubuntu) it works.

In jenkins.io's build failure, the PATH word is just not replaced. In my environment, it is different, the PATH word is not there anymore and the value of my PATH environment variable is truncated.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 19, 2019, 11:11:02 PM9/19/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ assigned an issue to Unassigned
Change By: Allan BURDAJEWICZ
Assignee: Allan BURDAJEWICZ

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 19, 2019, 11:11:02 PM9/19/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ assigned an issue to Allan BURDAJEWICZ
Change By: Allan BURDAJEWICZ
Assignee: Emilio  Escobar Allan BURDAJEWICZ

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 19, 2019, 11:15:02 PM9/19/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ commented on Bug JENKINS-59455
 
Re: CheckFilterTest failing on environment.txt

I have noticed that:

It is my understanding that this test relies on the Environment Variables content to be filtered ? When I use a PrefilteredContent instead of the a PrintedContent and filter the entire line, it fix the text for me locally. Removing the cache however has no effect.

Maybe Ramon Leon knows what is going on ?

manuelramonleonjimenez@gmail.com (JIRA)

unread,
Nov 5, 2019, 6:11:02 AM11/5/19
to jenkinsc...@googlegroups.com

The environment.txt file is written by a PrintedContent which extends the Content which has shouldBeFiltered = true, so the file should be filtered.

 

The CheckFilterTest supposes the environment.txt file in the bundle will have the path word, it's always on window or linux environments. The file is filled up with the result of a call to System.getenv(). Maybe the path variable is not between the env vars defined where the bundle is generated, but it's unlikely I guess.

 

manuelramonleonjimenez@gmail.com (JIRA)

unread,
Nov 5, 2019, 6:13:03 AM11/5/19
to jenkinsc...@googlegroups.com
Ramon Leon edited a comment on Bug JENKINS-59455
The environment.txt file is written by a PrintedContent which extends the Content which has shouldBeFiltered = true, so the file should be filtered.

 

The CheckFilterTest supposes the environment.txt file in the bundle will have the _*path*_ word, it's always on window or linux environments. The file is filled up with the result of a call to _System.getenv()_. Maybe the path variable is not between the env vars defined where the bundle is generated, but it's unlikely I guess.

 
[https://github.com/jenkinsci/support-core-plugin/blob/0695d2acea1300f2133522b722ad4e5cc8651c63/src/test/java/com/cloudbees/jenkins/support/CheckFilterTest.java#L234-L237]

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Nov 5, 2019, 8:14:02 AM11/5/19
to jenkinsc...@googlegroups.com

> it's always on window or linux environments

Well, my environment is a proof it's not necessarily the case, or there's a bug somewhere. Hopefully it's in the tests only.
Interestingly, I am reproducing that test failure every runs on the CLI. And I have no error while running the test from inside IntelliJ.

bmathus+ossjira@cloudbees.com (JIRA)

unread,
Nov 5, 2019, 8:24:03 AM11/5/19
to jenkinsc...@googlegroups.com
Baptiste Mathus edited a comment on Bug JENKINS-59455
>  it's always on window or linux environments

Well, my environment is a proof (I'm running Linux) it's not necessarily the case :) , or there's a bug somewhere. Hopefully it's in the tests only.

Interestingly, I am reproducing that test failure every runs on the CLI. And I have no error while running the test from inside IntelliJ.

manuelramonleonjimenez@gmail.com (JIRA)

unread,
Nov 5, 2019, 8:38:03 AM11/5/19
to jenkinsc...@googlegroups.com

Then it would be great if we use another word instead of path. But not sure which one could we use. Maybe some env var that is always set during the tests?

manuelramonleonjimenez@gmail.com (JIRA)

unread,
Nov 5, 2019, 8:40:02 AM11/5/19
to jenkinsc...@googlegroups.com
Ramon Leon edited a comment on Bug JENKINS-59455
Then it would be great if we use another word instead of _path_. But not sure which one could we use. Maybe some env var that is always set during the tests? . There is a way to add env vars but it implies using reflection and _setAccesible(true)_ which I don't like.

egutierrez@cloudbees.com (JIRA)

unread,
Nov 22, 2019, 9:49:03 AM11/22/19
to jenkinsc...@googlegroups.com
Evaristo Gutierrez started work on Bug JENKINS-59455
 
Change By: Evaristo Gutierrez
Status: Open In Progress

egutierrez@cloudbees.com (JIRA)

unread,
Nov 22, 2019, 9:49:04 AM11/22/19
to jenkinsc...@googlegroups.com

egutierrez@cloudbees.com (JIRA)

unread,
Nov 22, 2019, 10:08:03 AM11/22/19
to jenkinsc...@googlegroups.com

egutierrez@cloudbees.com (JIRA)

unread,
Nov 25, 2019, 9:19:04 AM11/25/19
to jenkinsc...@googlegroups.com

Summarizing the changes proposed by Ramon Leon and myself in https://github.com/jenkinsci/support-core-plugin/pull/200:

  • Use the first available env variable, and not path, to be sure it's available.
  • Wait for the created agent to be online.
  • Considerate '\0' (NUL character) as a character that appears to mark the end of a line, and so it must not make files containing it to be considered as binary files.
Reply all
Reply to author
Forward
0 new messages