-
Notifications
You must be signed in to change notification settings - Fork 850
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
Add a new StressChaos
to generate plenty of stresses
#332
Conversation
StressChaos
to generate plenty of stressesStressChaos
to generate plenty of stresses
well done |
Codecov Report
@@ Coverage Diff @@
## master #332 +/- ##
=======================================
Coverage 59.02% 59.02%
=======================================
Files 68 68
Lines 4369 4369
=======================================
Hits 2579 2579
Misses 1598 1598
Partials 192 192 Continue to review full report at Codecov.
|
StressChaos
to generate plenty of stressesStressChaos
to generate plenty of stresses
I'm very pleased to say that it's ready to be reviewed now ! Please help me to take a look. @zhouqiang-cl @ethercflow ❤️ |
Still missing unit tests for it since I'm not familiar with the current testing framework. Maybe I could add them later in another PR ? |
@AngleNet Good job! |
StressChaos
to generate plenty of stressesStressChaos
to generate plenty of stresses
Have you ever tested this feature in contained environment, such as
|
What did you mean it didn’t work? I see the stressors are injected |
Yes, it is injected. But the memory/CPU is not increasing at all. They remain the same. Is it the expected behavior? I guess no? Or maybe the measuring method is not correct. |
I also run stressChaos in my environment, this is work for me, but we can't find this |
api/v1alpha1/stresschaos_webhook.go
Outdated
} | ||
|
||
// Validate validates whether the Stressors are all well defined | ||
func (in *Stressors) Validate(parent *field.Path, errs field.ErrorList) field.ErrorList { |
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.
func (in *Stressors) Validate(parent *field.Path, errs field.ErrorList) field.ErrorList { | |
func (in *Stressors) Validate(parent *field.Path) field.ErrorList { |
keep the same style
api/v1alpha1/stresschaos_webhook.go
Outdated
} | ||
|
||
// Validate validates whether the Stressor is well defined | ||
func (in *Stressor) Validate(parent *field.Path, errs field.ErrorList) field.ErrorList { |
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.
func (in *Stressor) Validate(parent *field.Path, errs field.ErrorList) field.ErrorList { | |
func (in *Stressor) Validate(parent *field.Path) field.ErrorList { |
api/v1alpha1/stresschaos_webhook.go
Outdated
} | ||
|
||
// Validate validates whether the MemoryStressor is well defined | ||
func (in *MemoryStressor) Validate(parent *field.Path, errs field.ErrorList) field.ErrorList { |
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.
func (in *MemoryStressor) Validate(parent *field.Path, errs field.ErrorList) field.ErrorList { | |
func (in *MemoryStressor) Validate(parent *field.Path) field.ErrorList { |
/run-e2e-test |
api/v1alpha1/stresschaos_types.go
Outdated
stressors += fmt.Sprintf(" --vm %d --vm-keep", in.MemoryStressor.Workers) | ||
if len(in.MemoryStressor.Size) != 0 { | ||
if in.MemoryStressor.Size[len(in.MemoryStressor.Size)-1] != '%' { | ||
size, _ := units.FromHumanSize(in.MemoryStressor.Size) |
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.
Handle this error
/merge |
/run-all-tests |
dismiss
cherry pick to release-0.8 failed |
* Add stress chaos type
* Add stress chaos type Co-authored-by: AngleNet <[email protected]>
* Add stress chaos type
What problem does this PR solve?
Add a new
StressChaos
to generate plenty of stresses over a collection of pods. We can burn cpus #144 , eat memory #145 and so on.What is changed and how does it work?
Inject stresses into container's
cgroup
Check List
Tests
Code changes
Side effects
Related changes
Does this PR introduce a user-facing change?: