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

Use enhanced InboundAgentRule #7192

Merged
merged 7 commits into from
Oct 10, 2022
Merged

Conversation

basil
Copy link
Member

@basil basil commented Sep 29, 2022

Security218Test has flaked a few times with:

22:47:00  [ERROR] jenkins.security.Security218Test.jnlpSlave  Time elapsed: 80.632 s  <<< FAILURE!
22:47:00  java.lang.AssertionError: The JNLP agent failed to connect
22:47:00        at jenkins.security.Security218Test.launchJnlpSlave(Security218Test.java:128)
22:47:00        at jenkins.security.Security218Test.jnlpSlave(Security218Test.java:66)
22:47:00        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22:47:00        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
22:47:00        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
22:47:00        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
22:47:00        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
22:47:00        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
22:47:00        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
22:47:00        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
22:47:00        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
22:47:00        at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:613)
22:47:00        at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:299)
22:47:00        at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:293)
22:47:00        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
22:47:00        at java.base/java.lang.Thread.run(Thread.java:829)

Looking into the failure further, I suspect this because we aren't starting this with the -Xmx JVM option like we do everywhere else. So my theory is that JVM ergonomics kicks in and sizes the JVM incorrectly, which results in memory exhaustion.

Whether or not that theory is correct, we are running this test inconsistently with other inbound agent tests. So I am introducing jenkinsci/jenkins-test-harness#493 to serve as a consistent way of running inbound agent tests and converting (the vast majority of) such tests in core to use the new functionality. If the consistent use of -Xmx in that method helps with the flakiness here, great. In the worst case, it cannot hurt to have a cleaner interface and more consistent test execution. If the common functionality being used here has flakiness bugs, we can fix them in one place and then the fixes will apply to all tests, something that isn't possible with the copypasta we have today.

Proposed changelog entries

N/A

Proposed upgrade guidelines

N/A

Submitter checklist

  • (If applicable) Jira issue is well described
  • Changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developer, depending on the change) and are in the imperative mood. Examples
    • Fill-in the Proposed changelog entries section only if there are breaking changes or other changes which may require extra steps from users during the upgrade
  • Appropriate autotests or explanation to why this change has no tests
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadoc, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO") if applicable.
  • New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content-Security-Policy directives (see documentation on jenkins.io).
  • For dependency updates: links to external changelogs and, if possible, full diffs

Desired reviewers

@mention

Maintainer checklist

Before the changes are marked as ready-for-merge:

  • There are at least 2 approvals for the pull request and no outstanding requests for change
  • Conversations in the pull request are over OR it is explicit that a reviewer does not block the change
  • Changelog entries in the PR title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood
  • Proper changelog labels are set so that the changelog can be generated automatically
  • If the change needs additional upgrade steps from users, upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the PR title. (example)
  • If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).

@basil basil added the skip-changelog Should not be shown in the changelog label Sep 29, 2022
@basil
Copy link
Member Author

basil commented Sep 30, 2022

This build failed with a stack trace unrelated to the one mentioned in this PR's description: it seems that in addition to the inbound agent launch being flaky, the test case itself is flaky once the inbound agent is launched. Will debug that issue separately.

@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Oct 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

Please take a moment and address the merge conflicts of your pull request. Thanks!

@github-actions github-actions bot removed the unresolved-merge-conflict There is a merge conflict with the target branch. label Oct 4, 2022
@basil basil marked this pull request as ready for review October 5, 2022 19:59
@NotMyFault NotMyFault requested a review from a team October 6, 2022 08:13
@MarkEWaite
Copy link
Contributor

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

@MarkEWaite MarkEWaite added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 7, 2022
@basil basil merged commit 6a46e97 into jenkinsci:master Oct 10, 2022
@basil basil deleted the InboundAgentRule branch October 10, 2022 15:48
anurag-harness pushed a commit to anurag-harness/jenkins that referenced this pull request Oct 17, 2022
anurag-harness added a commit to anurag-harness/jenkins that referenced this pull request Oct 17, 2022
* Add "Testing done" section to PR template (jenkinsci#7218)

* Use enhanced `InboundAgentRule` (jenkinsci#7192)

Co-authored-by: Basil Crow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback skip-changelog Should not be shown in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants