Skip to content

test: add disk chaos injection in e2e engine #2280

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Abingcbc
Copy link
Collaborator

No description provided.

func DiskFull(ctx context.Context, time int) (context.Context, error) {
switch setup.Env.GetType() {
case "host":
command := "/opt/chaosblade/blade create disk fill --path /usr/local/ilogtail/ --size 409600 --timeout " + strconv.FormatInt(int64(time), 10)
Copy link
Collaborator

Choose a reason for hiding this comment

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

直接设定409600是不是不稳定的因素?后续万一机器换了,可能用例了就失效了,但是我们又发现不了。这个值应该是根据磁盘空间的百分比算出来的吧。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

获取磁盘空间百分比有点麻烦。调整成4096000了,4000GB应该超过了大多数磁盘的上限。设置一个很大的值,在注入故障的时候就会把磁盘打满。

Copy link
Collaborator

Choose a reason for hiding this comment

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

4000GB 才4T,这个不够大吧。可以看下EBS的官网,云盘上限是65,536GiB

@@ -39,6 +39,9 @@ func ScenarioInitializer(ctx *godog.ScenarioContext) {
// chaos
ctx.Given(`^network delay package \{(\d+)\}ms for ip \{(.*)\}`, chaos.NetworkDelay)
ctx.Given(`^network lost package \{(\d+)\}% for ip \{(.*)\}`, chaos.NetworkLoss)
ctx.Given(`^disk full for \{(\d+)\} seconds$`, chaos.DiskFull)
ctx.Given(`^disk burn read for \{(\d+)\} seconds$`, chaos.DiskBurRead)
Copy link
Collaborator

Choose a reason for hiding this comment

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

disk burn read 没用上?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

主机监控相关的测试case会用到。

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.

3 participants