-
Notifications
You must be signed in to change notification settings - Fork 111
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
Fix "deadline exceeded" issues discovered in conformance tests #643
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ea2bb3e
make sure all context errors get correctly wrapped with 'cancelled' o…
jhump 07ab64b
Merge branch 'main' into jh/deadline-exceeded-issues
jhump d5965e8
add test to repro issue
jhump 39a162c
report more details to make it easier to investigate source of bad er…
jhump d42edba
fix remaining issues found by tests
jhump 199d17f
make linter happy
jhump 2711779
Merge branch 'main' into jh/deadline-exceeded-issues
jhump f895d34
don't run these slow tests in CI on every commit
jhump e06e630
review feedback
jhump 49f888c
run slow test in separate CI job, only for latest Go and linux, so we…
jhump 7aa1d1f
rearrange; 'make' runs slow tests
jhump 76ee0c6
'make test' should also run slow tests
jhump 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 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 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 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 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 |
---|---|---|
|
@@ -90,6 +90,10 @@ func (c *compressionPool) Decompress(dst *bytes.Buffer, src *bytes.Buffer, readM | |
bytesRead, err := dst.ReadFrom(reader) | ||
if err != nil { | ||
_ = c.putDecompressor(decompressor) | ||
err = wrapIfContextError(err) | ||
if connectErr, ok := asError(err); ok { | ||
return connectErr | ||
} | ||
return errorf(CodeInvalidArgument, "decompress: %w", err) | ||
} | ||
if readMaxBytes > 0 && bytesRead > readMaxBytes { | ||
|
@@ -111,8 +115,12 @@ func (c *compressionPool) Compress(dst *bytes.Buffer, src *bytes.Buffer) *Error | |
if err != nil { | ||
return errorf(CodeUnknown, "get compressor: %w", err) | ||
} | ||
if _, err := io.Copy(compressor, src); err != nil { | ||
if _, err := src.WriteTo(compressor); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just for consistency/symmetry with the decompress code above, which directly calls |
||
_ = c.putCompressor(compressor) | ||
err = wrapIfContextError(err) | ||
if connectErr, ok := asError(err); ok { | ||
return connectErr | ||
} | ||
return errorf(CodeInternal, "compress: %w", err) | ||
} | ||
if err := c.putCompressor(compressor); err != nil { | ||
|
This file contains 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
Oops, something went wrong.
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.
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.
Talked to Josh live about this, but I'd love for this to be carved up a little differently. Locally, I'd really like
make
andmake test
to run these slower smoke tests. In CI, the highly-matrixed tests should run all the tests except the smoke tests. The new job (slowtest
) should run the slow tests, but it would be okay with me if it also ran the faster tests.I don't care that much whether we carve up the tests with an environment variable,
testing.Short()
, or with build tags.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.
make test
now runs both short and slow tests. CI "Test" job only runs short tests, and there's a separate "Slow Tests" job for the others. Did this withgo test -short
and a check in the test (if testing.Short() { t.Skip(...) }
).Also, while factoring out slow tests to a parallel job, I did the same for conformance tests, to shorten the critical path through the CI workflow.
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.
Because the main CI job must re-build the code (to instrument with race detector) and also does linting, the new slowtest job is actually faster than that other job (for now at least). So this new job does not increase the total duration. The longest job is still Windows, by a good margin.