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

Fixing use of Timeout #464

Merged
merged 1 commit into from
Dec 19, 2023
Merged

Fixing use of Timeout #464

merged 1 commit into from
Dec 19, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented Dec 18, 2023

Still trying to fix timeouts occurring in CI from this plugin.

docker ps -aq | xargs docker rm -f
docker image ls --format {{.Repository}}:{{.Tag}} | egrep 'ssh-agent|testcontainers|ubuntu' | xargs docker image rm
docker image prune --force
mvn test -Dtest='hudson.plugins.sshslaves.agents.**.*Test'

shows the first test, AgentCurve25519Sha256ConnectionTest, taking >4m (top shows some docker, a lot of dpkg). Subsequent tests mostly run in <10s, so layer caching is effective.

@jglick jglick requested a review from a team as a code owner December 18, 2023 19:45
@jglick
Copy link
Member Author

jglick commented Dec 19, 2023

From a @cloudbees CI run of AgentECConnectionTest (total time 127s):

…
Dec 19, 2023 2:07:56 AM org.testcontainers.images.builder.ImageFromDockerfile resolve
INFO: Transferred 2 KB to Docker daemon
Dec 19, 2023 2:09:53 AM org.testcontainers.containers.GenericContainer tryStart
INFO: Creating container for image: ssh-agent-ec:latest
…

@@ -46,11 +46,15 @@ public class AgentConnectionBase {
@ClassRule
public static CheckIsDockerAvailable isDockerAvailable = new CheckIsDockerAvailable();

@Rule
@Rule(order = 10)
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously, the 3m default timeout in JenkinsRule superseded the expressed timeout here.

public JenkinsRule j = new JenkinsRule();

@Rule
public Timeout globalTimeout= new Timeout(4, TimeUnit.MINUTES);
@Rule(order = -10)
Copy link
Member Author

Choose a reason for hiding this comment

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

Default order is -1 so this seems to make it apply to @Rule GenericContainer in subclasses.

public Timeout globalTimeout = Timeout.builder().withTimeout(10, TimeUnit.MINUTES).withLookingForStuckThread(true).build();

protected AgentConnectionBase() {
j.timeout = 0;
Copy link
Member Author

Choose a reason for hiding this comment

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

Redundant.

@kuisathaverat kuisathaverat merged commit 64ee6bf into jenkinsci:main Dec 19, 2023
13 checks passed
@jglick jglick deleted the Timeout branch December 19, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants