-
-
Notifications
You must be signed in to change notification settings - Fork 4
Introduce a new hook-powered chaos test configuration #666
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ inputs: | |
| - html | ||
| - headless | ||
| - empty | ||
| - chaos | ||
| edition: | ||
| description: Edition | ||
| required: true | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # The server MUST NOT crash on corrupted indexed data | ||
|
|
||
| # Corrupted routes.bin node indices | ||
| GET {{base}}/self/v1/api/list | ||
| [Options] | ||
| retry: 3 | ||
| retry-interval: 1000 | ||
| HTTP * | ||
|
|
||
| GET {{base}}/ | ||
| [Options] | ||
| retry: 3 | ||
| retry-interval: 1000 | ||
| HTTP * | ||
|
|
||
| GET {{base}}/self/v1/api/schemas/metadata/test/schemas/string | ||
| [Options] | ||
| retry: 3 | ||
| retry-interval: 1000 | ||
| HTTP * | ||
|
|
||
| GET {{base}}/does-not-exist/at/all | ||
| [Options] | ||
| retry: 3 | ||
| retry-interval: 1000 | ||
| HTTP * | ||
|
|
||
| # Corrupted directory.metapack metadata with wrong types | ||
| GET {{base}}/self/v1/api/list | ||
| [Options] | ||
| retry: 3 | ||
| retry-interval: 1000 | ||
| HTTP * | ||
|
|
||
| # Deleted search.metapack | ||
| GET {{base}}/self/v1/api/schemas/search?q=test | ||
| [Options] | ||
| retry: 3 | ||
| retry-interval: 1000 | ||
| HTTP * | ||
|
|
||
| # Corrupted locations.metapack with empty object | ||
| POST {{base}}/self/v1/api/schemas/trace/test/schemas/string | ||
| Content-Type: application/json | ||
| [Options] | ||
| retry: 3 | ||
| retry-interval: 1000 | ||
| ``` | ||
| "hello" | ||
| ``` | ||
| HTTP * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": [ "./one-html-community.json" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "extends": [ "./one-html-enterprise.json" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -o errexit | ||
| set -o nounset | ||
|
|
||
| if [ "$#" -ne 3 ] | ||
| then | ||
| echo "Usage: $0 <configuration> <edition> <output>" 1>&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| CONFIGURATION="$1" | ||
| EDITION="$2" | ||
| OUTPUT="$3" | ||
|
|
||
| echo "Running prepare hook..." 1>&2 | ||
| echo " CONFIGURATION: $CONFIGURATION" 1>&2 | ||
| echo " EDITION: $EDITION" 1>&2 | ||
| echo " OUTPUT: $OUTPUT" 1>&2 | ||
|
|
||
| if [ "$CONFIGURATION" != "chaos" ] | ||
| then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # To test how the server deals with corrupted data | ||
| echo "Applying chaos corruptions..." 1>&2 | ||
|
|
||
| echo " Corrupting root node first_literal_child to an out-of-bounds index..." 1>&2 | ||
| test -f "$OUTPUT/routes.bin" | ||
| printf '\x00\x00\x10\x00' | \ | ||
| dd of="$OUTPUT/routes.bin" bs=1 seek=24 conv=notrunc 2>/dev/null | ||
jviotti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| echo " Corrupting second node string_offset to point past the file end..." 1>&2 | ||
| printf '\x00\x00\x00\x7f' | \ | ||
| dd of="$OUTPUT/routes.bin" bs=1 seek=40 conv=notrunc 2>/dev/null | ||
|
|
||
| echo " Replacing directory.metapack metadata with wrong types..." 1>&2 | ||
| test -f "$OUTPUT/explorer/%/directory.metapack" | ||
| printf '{"version":1,"checksum":99999,"lastModified":0,"mime":false,"bytes":1,"duration":1,"encoding":"identity"}' \ | ||
| > "$OUTPUT/explorer/%/directory.metapack" | ||
|
|
||
| echo " Deleting search.metapack to trigger missing file assert..." 1>&2 | ||
| test -f "$OUTPUT/explorer/%/search.metapack" | ||
| rm -f "$OUTPUT/explorer/%/search.metapack" | ||
|
|
||
| echo " Replacing locations.metapack with empty object for test/schemas/string..." 1>&2 | ||
| test -f "$OUTPUT/schemas/test/schemas/string/%/locations.metapack" | ||
| printf '{"version":1,"checksum":"x","lastModified":"Thu, 01 Jan 2025 00:00:00 GMT","mime":"application/json","bytes":2,"duration":1,"encoding":"identity"}{}' \ | ||
| > "$OUTPUT/schemas/test/schemas/string/%/locations.metapack" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.