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

Fix load test failures #682

Merged
merged 4 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions load_tests/load_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ def calculate_total_input_number(throughput):
# 1. Configure task definition for each load test based on existing templates
# 2. Register generated task definition
def generate_task_definition(session, throughput, input_logger, s3_fluent_config_arn):
if not hasattr(generate_task_definition, "counter"):
generate_task_definition.counter = 0 # it doesn't exist yet, so initialize it
generate_task_definition.counter += 1

# Generate configuration information for STD and TCP tests
std_config = resource_resolver.get_input_configuration(PLATFORM, resource_resolver.STD_INPUT_PREFIX, throughput)
custom_config = resource_resolver.get_input_configuration(PLATFORM, resource_resolver.CUSTOM_INPUT_PREFIX, throughput)
Expand Down Expand Up @@ -214,7 +210,7 @@ def run_ecs_tests():
response = client.run_task(
cluster=ecs_cluster_name,
launchType='EC2',
taskDefinition=f'{PREFIX}{OUTPUT_PLUGIN}-{throughput}'
taskDefinition=f'{PREFIX}{OUTPUT_PLUGIN}-{throughput}-{input_logger['name']}'
)
names[f'{OUTPUT_PLUGIN}_{throughput}_task_arn'] = response['tasks'][0]['taskArn']

Expand All @@ -224,12 +220,12 @@ def run_ecs_tests():
# wait for tasks and validate
for input_logger in INPUT_LOGGERS:
# Wait until task stops and start validation
session = get_sts_boto_session()
processes = []

client = session.client('ecs')
waiter = client.get_waiter('tasks_stopped')

for throughput in THROUGHPUT_LIST:
session = get_sts_boto_session()
client = session.client('ecs')
waiter = client.get_waiter('tasks_stopped')
task_arn = names[f'{OUTPUT_PLUGIN}_{throughput}_task_arn']
waiter.wait(
cluster=ecs_cluster_name,
Expand Down Expand Up @@ -398,7 +394,7 @@ def parse_json_template(template, dict):
for key in dict:
if(key[0] == '$'):
data = data.replace(key, dict[key])
elif(key == OUTPUT_PLUGIN):
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

we mean to make this change??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from slack:

this one is safe
previously it would relpace the vars if the key was for the. current output plugin
now it just iterates overall of them

it does a find and replace

so if the string isn't in our template, it own't replace it
this old logic was unneeded and wrong

for sub_key in dict[key]:
data = data.replace(sub_key, dict[key][sub_key])
return data
Expand Down
2 changes: 1 addition & 1 deletion load_tests/task_definitions/cloudwatch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"family": "load-test-fluent-bit-cloudwatch-$THROUGHPUT",
"family": "load-test-fluent-bit-cloudwatch-$THROUGHPUT-$INPUT_NAME",
"taskRoleArn": "$TASK_ROLE_ARN",
"executionRoleArn": "$TASK_EXECUTION_ROLE_ARN",
"networkMode": "bridge",
Expand Down
2 changes: 1 addition & 1 deletion load_tests/task_definitions/firehose.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"family": "load-test-fluent-bit-firehose-$THROUGHPUT",
"family": "load-test-fluent-bit-firehose-$THROUGHPUT-$INPUT_NAME",
"taskRoleArn": "$TASK_ROLE_ARN",
"executionRoleArn": "$TASK_EXECUTION_ROLE_ARN",
"networkMode": "bridge",
Expand Down
2 changes: 1 addition & 1 deletion load_tests/task_definitions/kinesis.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"family": "load-test-fluent-bit-kinesis-$THROUGHPUT",
"family": "load-test-fluent-bit-kinesis-$THROUGHPUT-$INPUT_NAME",
"taskRoleArn": "$TASK_ROLE_ARN",
"executionRoleArn": "$TASK_EXECUTION_ROLE_ARN",
"networkMode": "bridge",
Expand Down
2 changes: 1 addition & 1 deletion load_tests/task_definitions/s3.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"family": "load-test-fluent-bit-s3-$THROUGHPUT",
"family": "load-test-fluent-bit-s3-$THROUGHPUT-$INPUT_NAME",
"taskRoleArn": "$TASK_ROLE_ARN",
"executionRoleArn": "$TASK_EXECUTION_ROLE_ARN",
"networkMode": "bridge",
Expand Down