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

Unclear how to put RemainingActivityListener into "wait" mode #803

Closed
sparrowt opened this issue Jul 11, 2024 · 5 comments
Closed

Unclear how to put RemainingActivityListener into "wait" mode #803

sparrowt opened this issue Jul 11, 2024 · 5 comments

Comments

@sparrowt
Copy link

Describe your use-case which is not covered by existing documentation.

#672 describes false positives from RemainingActivityListener but I'm actually seeing a true positive where it correctly identifies that a branch indexing job is still running, but simply logs a warning and carries on and then TemporaryDirectoryAllocator.dispose fails to delete the tmp directory due to that exact problem.

Stderr:

  51.632 [id=20]	WARNING	o.j.h.t.RemainingActivityListener#onTearDown: BranchIndexing[MyJobName] still seems to be running, which could break deletion of log files or metadata
  51.745 [id=20]	INFO	hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping Jenkins
  51.876 [id=20]	INFO	hudson.lifecycle.Lifecycle#onStatusUpdate: Jenkins stopped
  59.952 [id=20]	INFO	o.j.h.t.TemporaryDirectoryAllocator#dispose: deleting /tmp/j h2833791769982591998
  59.961 [id=203]	FINEST	hudson.XmlFile#write: Writing /tmp/j h2833791769982591998/jobs/MyJobName/indexing/indexing.xml

Resulting exception: (due to conflict between trying to delete a folder into which indexing.xml is being written)

java.io.IOException: /tmp/j h2833791769982591998/jobs/MyJobName
...
Caused by: java.nio.file.DirectoryNotEmptyException: /tmp/j h2833791769982591998/jobs

I found the option to "wait" instead of just logging a warning, which sounds like what I need - but how/where do I actually set something to make RemainingActivityListener.wait be true?

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

Are you interested in contributing to the documentation?

No response

@sparrowt
Copy link
Author

sparrowt commented Jul 11, 2024

Ah, this clearly shows how much of a Java n00b I am - I finally discovered that Boolean is java.lang.Boolean and that its getBoolean method is for getting system properties (despite not saying anything about properties in its name...).

So I guess the answer here is probably "you should have known" though the existance of this ticket shows that there is at least 1 person who's trying to use Jenkins but not experienced in Java, for whom this wasn't obvious at all (!)

My best guess so far of how to actually set this would be to add the following line to gradle.properties:

org.jvnet.hudson.test.RemainingActivityListener.wait=true

@timja
Copy link
Member

timja commented Jul 11, 2024

@sparrowt
Copy link
Author

sparrowt commented Jul 11, 2024

Ah nice, thanks so much for the reply - is that equivalent, but a better more explicit way of doing it?

@timja
Copy link
Member

timja commented Jul 11, 2024

Yes tests should cleanup after themselves, RemainingActivityListener is for catching mistakes in tests not something that should be used all the time

@sparrowt
Copy link
Author

Thank you, appreciate your help - I guess the google-ability of this ticket is probably sufficient to provide help to anyone else struggling as I did so happy to close this now.

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