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

Antagonize the Crucible Agent #1011

Merged
merged 4 commits into from
Nov 7, 2023
Merged

Conversation

jmpesp
Copy link
Contributor

@jmpesp jmpesp commented Oct 25, 2023

The agent-antagonist will stress test the Crucible agent by continuously requesting and deleting regions, randomly taking and deleting snapshots of those regions.

The `agent-antagonist` will stress test the Crucible agent by
continuously requesting and deleting regions, randomly taking and
deleting snapshots of those regions.
Copy link
Contributor

@leftwo leftwo left a comment

Choose a reason for hiding this comment

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

This is cool, and much needed to it sounds like.

I would like to see this running in CI, but to do that we need a way to loop for some time
or iteration count and that could be a follow on PR along with the buildomat stuff to
run it.

let log = build_logger();

let agent = if let Some(agent) = agent {
info!(log, "using agent at argument {:?}", agent);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Agent at address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed, see 1137af4

};

let dataset = if let Some(dataset) = dataset {
info!(log, "using dataset at argument {:?}", dataset);
Copy link
Contributor

Choose a reason for hiding this comment

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

Also Nit, using dataset {:?} maybe? Maybe for the other one too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed, see 1137af4

}

let client = get_client(&agent);
let r = client.region_get_snapshot(&RegionId(region_id.to_string()), &snapshot_id.to_string()).await;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did cargo fmt leave this line longer than 80 characters? Is it longer than 80?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's definitely longer, I wonder why fmt didn't pick it up?

create two new async functions to reduce indent level
Copy link
Contributor

@leftwo leftwo left a comment

Choose a reason for hiding this comment

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

Did you move the entire loop to a new function just to
reduce the lines to < 80 characters?

@leftwo
Copy link
Contributor

leftwo commented Nov 6, 2023

Did you move the entire loop to a new function just to reduce the lines to < 80 characters?

If it's just a move, then go ahead and merge this with main.
But, if there are other changes, let me know and I'll actually look at it. :)

@jmpesp
Copy link
Contributor Author

jmpesp commented Nov 7, 2023

Did you move the entire loop to a new function just to reduce the lines to < 80 characters?

I did! Merging now.

@jmpesp jmpesp merged commit 6df8a67 into oxidecomputer:main Nov 7, 2023
18 checks passed
@jmpesp jmpesp deleted the agent_antagonist branch November 7, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants