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

feat: allow to skip invalid assert conditions #6

Merged
merged 2 commits into from
Dec 12, 2024
Merged

feat: allow to skip invalid assert conditions #6

merged 2 commits into from
Dec 12, 2024

Conversation

medcl
Copy link
Member

@medcl medcl commented Dec 11, 2024

This pull request includes several changes to improve error handling and reporting in the load testing framework. The most important changes include adding a new configuration option to skip invalid assertions, updating the statistics structure to differentiate between different types of assertion errors, and adding validation for requests during the warmup phase.

Closes #5

Improvements to error handling:

  • domain.go: Added SkipInvalidAssert field to RunnerConfig struct to allow skipping invalid assertions.

Updates to statistics reporting:

  • loader.go: Changed NumInvalid to NumAssertInvalid and added NumAssertSkipped in LoadStats struct to better categorize assertion errors.
  • loader.go: Updated error counting logic in doRequest function to increment NumAssertSkipped if SkipInvalidAssert is enabled and NumAssertInvalid otherwise. [1] [2]

Request validation:

  • loader.go: Added request validation in Warmup function to log and panic on invalid requests.

Updates to main loader logic:

  • main.go: Updated startLoader and runLoaderConfig functions to handle new statistics fields and print detailed assertion error counts. [1] [2] [3]

@medcl
Copy link
Member Author

medcl commented Dec 11, 2024

Depends on : infinilabs/framework#7

@medcl medcl requested review from luohoufu and SteveLauC December 12, 2024 01:25
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Verified that this patch implements the feature requested in #5:

[12-12 09:29:51] [ERR] [loader.go:486] invalid request: missing required Host header in request
panic: invalid request

goroutine 67 [running]:
main.(*LoadGenerator).Warmup(0x1?, 0xc00017e000)
	/home/steve/go/src/infini.sh/loadgen/loader.go:487 +0x566
main.startLoader(0xc00017e000)
	/home/steve/go/src/infini.sh/loadgen/main.go:107 +0x1af
main.runLoaderConfig(0xc00017e000)
	/home/steve/go/src/infini.sh/loadgen/main.go:443 +0x27
main.runDSL(0xc000557d40, {0xc00017c500, 0x49a})
	/home/steve/go/src/infini.sh/loadgen/main.go:434 +0xc5
main.runDSLFile(0xc000557d40, {0x7ffd275bad8d?, 0xc000174e90?})
	/home/steve/go/src/infini.sh/loadgen/main.go:429 +0x13a
main.main.func2.1()
	/home/steve/go/src/infini.sh/loadgen/main.go:373 +0xb0
created by main.main.func2 in goroutine 82
	/home/steve/go/src/infini.sh/loadgen/main.go:369 +0x56

And runner config entry skip_invalid_assert: true does let Loadgen skip invalid assert conditions

@medcl medcl merged commit 9e07eef into main Dec 12, 2024
2 checks passed
@medcl medcl deleted the assert1 branch December 12, 2024 02:47
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.

If host is missing from the URL, Loadgen should exit with clear error message rather than sending requests
2 participants