Commit Graph

302 Commits

Author SHA1 Message Date
zpencer 2347384256
GAE: call channel.shutdown() (#4274)
OkHttpClientInteropServlet and NettyClientInteropServlet both run the
@After method from AbstractInteropTest. Let's make sure we await
termination.

For the long lived channel test, do the cleanup in `destroy`.
2018-04-02 16:02:55 -07:00
Shohei Kamimori 156cc44c5f interop-testing: fix empty proto package name
Intended to resolve #4241
grpc-java has already diverged this proto file, so changing the
this package name is reasonable for now.
2018-03-29 10:37:53 -07:00
Eric Anderson 4e82e62eaa
Fix compilation in Java 9 2018-03-28 17:13:39 -07:00
Arnout Engelen 03a00aa8cf interop-testing: client compressed tests without probing (#4279) 2018-03-28 15:51:03 -07:00
zpencer 14003c14cc
build.gradle: bump protobuf plugin to 0.8.5 (#4101)
This update automatically adds generated sources and proto IDLs to the
`idea` plugin.
2018-03-26 17:29:55 -07:00
Eric Anderson 25f357699a
okhttp: Convert to internal ConnectionSpec eagerly
This allows ProGuard to remove OkHttp's ConnectionSpec in most cases,
saving about 40 methods. The savings won't be realized until
DEFAULT_CONNECTION_SPEC is removed.
2018-03-26 15:39:56 -07:00
Eric Anderson 7eab0d9468 netty: Add support for Conscrypt 2018-03-23 10:05:45 -07:00
Eric Anderson 0859d480e7 Move TlsTest from interop-testing to netty 2018-03-23 10:05:45 -07:00
Eric Gribkoff 52fedb624d
okhttp: support JDK9 ALPN (#4136) 2018-03-20 17:29:24 -07:00
Eric Anderson ca7b3dad11
interop-testing: Improve failure messages for ping_ping
Timeouts and Status returns can be common, and previously those cases
weren't that clear. For example, if there was a StatusRuntimeException
it would just print the status code and message, but not the causal
chain.
2018-03-07 13:28:41 -08:00
Eric Anderson 26719bdc5c Partially revert "core: change serverimpl,servercallimpl's internalclose to cancel stream (#4038)"
This partially reverts commit 48ca4527c1.
It leaves the changes to ServerCallImpl and test.

This also partially reverts "Lint fixes" commit
3002a23a0f which removed unused variables
which are now necessary again.

This is reverted for the combined result of two issues:
* Some users are testing that they get UNKNOWN when the service throws.
  That's not unreasonable given the behavior was well-publicised when it
  changed in v1.5. We should probably keep the UNKNOWN in some common
  cases (like the service threw immediately, before sending anything).
* The client could see CANCELLED instead of INTERNAL as had been
  intended. It's unclear as to why (I didn't investigate heavily). This
  behavior is visible in MoreInProcessTest and was overlooked during
  review.
2018-03-02 13:35:06 -08:00
zpencer 066ad3ceac
buildscripts,travis: fetch from mvn with retries (#4140)
A band aid for #3284, to make its symptoms less noticeable.
2018-03-01 19:11:24 -08:00
Carl Mastrangelo 7af2373a03
core,netty,okhttp,alts,inprocess: deprecate usePlaintext(boolean) 2018-02-28 08:53:14 -08:00
Jiangtao Li d8630f2521 alts: add ALTS to interop tests 2018-02-23 12:44:18 -08:00
Rama Chavali 48ca4527c1 core: change serverimpl,servercallimpl's internalclose to cancel stream (#4038)
The HTTP/2 error code will be INTERNAL_ERROR for all cancel statuses,
except for DEADLINE_EXCEEDED and CANCELLED, which are mapped to
CANCELLED.
2018-02-22 11:09:21 -08:00
Eric Gribkoff 6f9b4e87e1
compiler: avoid invoking experimental method in generated code 2018-02-08 11:25:38 -08:00
Kun Zhang df65bef881
core: delete outboundMessage() and inboundMessage() on StreamTracer. (#4014)
They were deprecated in 1.7.0.
2018-01-29 13:42:14 -08:00
Eric Gribkoff d0bbeced80
interop-testing: fix race in TestServiceImpl 2018-01-10 14:27:15 -08:00
Eric Anderson af0283477d Update ErrorProne to 2.2.0 and fix failures 2018-01-10 14:14:27 -08:00
Eric Anderson 4bc0c95d0b Update ErrorProne to 2.1.3 and fix failures
The fixes could have subtle side-effects, but I did take care when making them.
2018-01-09 12:40:55 -08:00
Eric Anderson 35a6bf863d Enable the Guava Beta Checker 2018-01-08 14:52:51 -08:00
zpencer 173ca5d332
cronet, grpc-lb, interop-testing: fix lints #3848 2017-12-07 16:09:43 -08:00
Eric Anderson 2d88269965 Update to Truth 0.36
Due to transitive dependencies, this also upgrades Guava to 22. However
Truth is only used in our tests, so our users should be unimpacted.
2017-12-04 13:48:00 -08:00
Kun Zhang 3f1d370e47
interop-testing: stop using MockableSpan. (#3823)
Interop tests use actual Census implementations, while MockableSpan is
compatible with the Census OSS implementation, it doesn't work with
the google internal implementation, thus the tests will fail.
2017-12-04 11:13:58 -08:00
Kun Zhang efcd134209
interop-testing: start a new server for each test method. (#3816)
By doing this we can isolate the Census records for each test, and
eliminate the trial-and-error workaround in AbstractInteropTest.

This is a preferred fix for #3777 and supersedes #3803
2017-12-01 13:08:03 -08:00
Carl Mastrangelo aee5fc4176
all: update to proto 3.5.0 2017-11-30 11:50:19 -08:00
Eric Anderson 2bde25d2d9 testing: Remove DeadlineSubject
The class is still used internally, so we move it to context's tests for
it to be reused. To avoid a circular dependency with context's tests
depending on core's tests, StaticTestingClassLoader was also moved to
context's tests.

This is driven by a need to modernize DeadlineSubject for newer versions
of Truth, but the newer versions of Truth update Guava. To avoid leaking
the Guava update to all users of grpc-testing, we're removing the
Subject. In our internal tests we can update the Truth dependency with
less issue.
2017-11-22 17:57:46 -08:00
Eric Anderson 6bab82eeb6 auth: Use async version of getRequestMetadata
This avoids using DelayedStream and a thread hop when the credentials
are known immediately.
2017-11-17 11:52:07 -08:00
Kun Zhang ca9a41a46e
core: record RPC upstarts to Census. (#3708)
RPC upstarts are counted into metrics
RPC_{CLIENT,SERVER}_STARTED_COUNT. In addition, RPC completions are
counted into metrics RPC_{CLIENT,SERVER}_FINISHED_COUNT.  From these
metrics, users will be able to derive count of RPCs that are currently
active.
2017-11-10 17:22:22 -08:00
sebright ef2ec94911 core: use new OpenCensus stats/tagging API. (#3647)
This commit updates gRPC core to use io.opencensus:opencensus-api and
io.opencensus:opencensus-contrib-grpc-metrics instead of
com.google.instrumentation:instrumentation-api for stats and tagging. The gRPC
Monitoring Service continues to use instrumentation-api.

The main changes affecting gRPC:

- The StatsContextFactory is replaced by three objects, StatsRecorder, Tagger,
  and TagContextBinarySerializer.

- The StatsRecorder, Tagger, and TagContextBinarySerializer are never null,
  but the objects are no-ops when the OpenCensus implementation is not
  available.

This commit includes changes written by @songy23 and @sebright.
2017-11-07 12:25:03 -08:00
Carl Mastrangelo 1bc7d76d3a
interop-testing: make max size tests more deterministic
This change removes some of the non deterministic size outputs for
proto.  Instead of serializing the message and measuring the size,
measure before serialization.  As long as the remote always returns
using the same encoder, this should be stable.
2017-11-06 12:34:10 -08:00
Eric Anderson f9f603570d Allow tests to run on IPv6-less machines
Our Travis-CI builds are failing with "Protocol family unavailable" due
to the usage of ::1. Although it's 2017 and we'd expect to have ipv6
_loopback_ anywhere that mattered, apparently that's not the case.

The tests now work equally well on IPv4-only and IPv6-only machines.
2017-11-02 13:32:34 -07:00
Kun Zhang d87ef74082
core: set sampled for local span per MethodDescriptor. (#3627)
This moves away from the global String-based Span name registry which
is not as flexible as we desire.

Also renamed the option name to be more accurate.  This is not
API-breaking because the origianl addition to MethodDescriptor and
code-gen didn't make it into the 1.7.0 release.
2017-11-01 16:46:05 -07:00
ZHANG Dapeng 8a9660c700
testing: move TestUtils.recordServerCallInterceptor internal 2017-11-01 09:37:42 -07:00
ZHANG Dapeng d6ff4c259f
testing: move io.grpc.testing.StreamRecorder to internal 2017-11-01 09:37:22 -07:00
Carl Mastrangelo 87c8791983
compiler: remove references to static fields 2017-10-31 15:24:48 -07:00
Carl Mastrangelo 30b59885b7
compiler: add methods for accessing method descriptors
* MethodDescriptor is lazy loaded, so protobuf loading only happens on demand.  This also means tracing registration happens  on demand.
* The names of the getters all being with `method`.  This makes it harder for autocomplete to pick them up.
* A new field is used, which matches the getter name.  Rather than make the new-getters reference the old-fields, make the old-fields reference the new getters.  This makes removal of the old-fields a simple operation.
* The getters may not be inlineable, but thats an easy fix if it ends up being a problem.  Not worth premature optimization (but is worth future work).

The expected timeline for this is adding this to the 1.8 cut, and deprecating the old-fields.  They will be removed in 1.9.
2017-10-30 10:30:34 -07:00
ZHANG Dapeng 7a4aa47070 core: remove unnecessary type params in ServerStreamTracer 2017-10-26 12:05:41 -07:00
Kun Zhang 9c817e5bb0 interop-test: disable message size check in interop-test client. (#3569)
The check fails in Java-Go interop test because of
grpc/grpc-go#1572

This is also needed for the internal gRPC-GFE test.

Resolves #3562
2017-10-12 17:14:16 -07:00
Kun Zhang 1e02b65c08 Fix interop_test client. 2017-10-10 13:46:51 -07:00
Kun Zhang 8edead0851 core: make in-process transport support StreamTracer
This is needed for both completeness and stats/tracing contexts propagation.

Stats recording with Census is intentionally disabled (#2284), while the rest of the Census-related logic work the same as on the other transports.
2017-10-09 10:14:36 -07:00
zpencer b07c70a09f gae-interop-testing: add GAE interop tests (#3535)
See `gae-interop-testing/README.md` for details on how to run the tests.
2017-10-06 10:44:58 -07:00
ZHANG Dapeng 80ac407c6c interop-testing: fix ErrorProne and Unused 2017-10-05 14:15:43 -07:00
Carl Mastrangelo 5e36a8deb5 all: upgrade to JUnit 4.12 2017-10-05 11:24:15 -07:00
zpencer 0d5943614e Make AbstractInteropTest runnable in GAE+jdk7 (#3533)
Avoid mocking and detect when a N/A test should be skipped.
2017-10-02 18:28:24 -07:00
Kun Zhang a6653bb135 core/compiler: register Span names for code-generated methods (take 2)
This is a more favorable approach than #3467. Doing the registration
in MethodDescriptor should allow us to deregister in case the
generated stub and its MethodDescriptors are garbage-collected
routinely, e.g., if they are loaded by a separate ClassLoader.
2017-09-25 15:38:48 -07:00
Eric Gribkoff 5ac9ad0c1f core: client supports inbound gzipped streams (#3403) 2017-09-25 09:01:53 -07:00
Kun Zhang 7e534ed704 core: record individual messages with sizes to Census/tracing (#3461)
Two methods, outboundMessageSent() and inboundMessageRead() are added to StreamTracer in order to associate individual messages with sizes. Both types of sizes are optional, as allowed by Census tracing.

Both methods accept a sequence number as the type ID as required by Census. The original outboundMesage() and inboundMessage() are also replaced by overrides that take the sequence number, to better match the new methods. The deprecation of the old overrides are tracked by #3460
2017-09-19 09:22:11 -07:00
Eric Anderson a3ff9cd784 all: Keep artifacts dependencyConvergence-clean
Maven Enforcer's dependencyConvergence is commonly used in Spring
projects, as it is inherited by all starter projects[1]. While I find
that option to be crazy and harmful (and would instead support
requireUpperBoundDeps), it does bother people.

1. https://github.com/spring-projects/spring-boot/blob/v1.5.6.RELEASE/spring-boot-starters/pom.xml#L94
2017-09-18 16:20:18 -07:00
Lukasz Strzalkowski 731bbefb17 core, compiler, protobuf: introduce MethodDescriptor#setSchemaDescriptor 2017-09-11 09:57:03 -07:00