-
Notifications
You must be signed in to change notification settings - Fork 136
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
Initial changes for distributed jmeter executor #4282
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of 70 files - 62 are copy/paste ones. can we do it better and have common packages for jmeter?
} | ||
} | ||
|
||
sl, err := slaves.NewClient(execution, r.Params, slaves.SlavesEnvOptions{RunPath: runPath, OverrideJvmArgs: "-Xmn256m -Xms512m -Xmx512m"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JVM args shouldn't be hardcoded, we should be able to override them
return *result.WithErrors(errors.Errorf("Getting error while creating slaves nodes: %v", err)), nil | ||
} | ||
|
||
args = append(args, fmt.Sprintf("-R %v", GetSlavesIpString(slavesNameIpMap))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to have dynamic arg as above -R <slaveAddresses>
} | ||
out = envManager.ObfuscateSecrets(out) | ||
|
||
defer sl.DeleteSlaves(slavesNameIpMap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move it ealier to CreateSlaves
const ( | ||
serverPort = 1099 | ||
localport = 60001 | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be able to redefine in config or parameters
|
||
// Wait for the pod to become ready | ||
conditionFunc := isPodReady(context.Background(), client.clientSet, p.Name, client.namespace) | ||
timeout := 5 * time.Minute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to const at least
conditionFunc := isPodReady(context.Background(), client.clientSet, p.Name, client.namespace) | ||
timeout := 5 * time.Minute | ||
|
||
err = wait.PollImmediate(time.Second, timeout, conditionFunc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also should be const, interval or something
func (client *Client) DeleteSlaves(slaveNameIpMap map[string]string) { | ||
for slaveName := range slaveNameIpMap { | ||
output.PrintLog(fmt.Sprintf("Deleting slave %v", slaveName)) | ||
client.clientSet.CoreV1().Pods(client.namespace).Delete(context.Background(), slaveName, metav1.DeleteOptions{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would record error, if we have it
Value: envParams.CloudAPIURL, | ||
}, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, it should be in one place in api or we will need to sync them
}, | ||
}, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be taken from template, we don't hard code spec
return *result.WithErrors(errors.Errorf("Getting error while creating slaves nodes: %v", err)), nil | ||
} | ||
|
||
args = append(args, fmt.Sprintf("-R %v", GetSlavesIpString(slavesNameIpMap))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments above
|
||
const ( | ||
serverPort = 1099 | ||
localport = 60001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again looks like a copy for above file
Value: envParams.CloudAPIURL, | ||
}, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, one more copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, it's good in general, but sounds like only 4 new files, we can organoe it better
942a37f
to
9ff550b
Compare
Unable to modify PR title. Initiating a new PR with an appropriate title following the correct naming conventions. |
Pull request description
Checklist (choose whats happened)
Breaking changes
Changes
Fixes