aboutsummaryrefslogtreecommitdiff
path: root/testing
AgeCommit message (Collapse)Author
2020-07-24Merge tag 'upstream/v1.16.1' into HEADHadrien Zalek
Update the Java gRPC implementation source to that of a released version (v1.16.1) instead of some intermediate commit after v1.15.0. Test: m grpc-java Bug: 148404241 Change-Id: I9c072aee054a4aecc1bdf39adf45e9a243b907f5
2020-06-03Build the gRPC Java testing libraryHadrien Zalek
Add a build module for the testing library which provides utilities for more convenient unit testing of gRPC servers and clients. Test: m grpc-java-testing Bug: 148404241 Change-Id: I7f9894d0fb05c07b816aeae029a4293f194c9064
2018-10-10core: add CallCredentials2 and deprecate CallCredentials' old interface (#4902)Kun Zhang
This is the first step of smoothly changing the CallCredentials API. Security level and authority are parameters required to be passed to applyRequestMetadata(). This change wraps them, along with MethodDescriptor and the transport attributes to RequestInfo, which is more clear to the implementers. ATTR_SECURITY_LEVEL is moved to the internal GrpcAttributes and annotated as TransportAttr, because transports are required to set it, but no user is actually reading them from {Client,Server}Call.getAttributes(). ATTR_AUTHORITY is removed, because no transport is overriding it. All involved interfaces are changed to abstract classes, as this will make further API changes smoother. The CallCredentials name is stabilized, thus we first introduce CallCredentials2, ask CallCredentials implementations to migrate to it, while GRPC accepting both at the same time, then replace CallCredentials with CallCredentials2.
2018-10-03core: add Grpc.TRANSPORT_ATTR_LOCAL_ADDR (#4906)Kun Zhang
Resolves #4135
2018-09-14all: use Java7 bracketsCarl Mastrangelo
2018-09-10testing: Fix flake in AbstractTransportTest.flowControlPushBackEric Anderson
This attempts to fix a flake seen exactly once with the currently-disabled OkHttpTransportTest.flowControlPushBack: ``` java.lang.AssertionError at org.junit.Assert.fail(Assert.java:86) at org.junit.Assert.assertTrue(Assert.java:41) at org.junit.Assert.assertTrue(Assert.java:52) at io.grpc.internal.testing.AbstractTransportTest.flowControlPushBack(AbstractTransportTest.java:1300) ``` That was a failure for assertTrue(serverStream.isReady()), because the awaitOnReady was finding the previous invocation of onReady. We now track how many times it has been called. This was a bug introduced in a8db154702 but wouldn't have been noticed since the in-process transport is deterministic.
2018-09-05all: prepend internal classes with Internal (#4826)zpencer
This is a safer way to hide the classes, because they will not appear in public targets for some build configurations.
2018-09-04all: move Channelz to io.grpc as InternalChannelz (#4797)zpencer
This is an API used to coordinate across packages and must live in `io.grpc`. Prepending `Internal` makes it easier to detect and hide this class from public visibility when using certain build tools. fixes #4796
2018-07-09Propagate EquivalentAddressGroup attributes to transportsEric Anderson
Most of the changes are changing the signature of newClientTransport. Since this is annoying, I choose to introduce a ClientTransportOptions object to avoid the churn in the future. With ClientTransportOptions in place, there's only a few lines necessary of plumbing for the Attributes: add the field to ClientTransportOptions and populate it in InternalSubchannel. There are no consumers of the field in this commit.
2018-06-11all: add gradle format checkerZHANG Dapeng
This PR adds an automatic gradle format checker and reformats all the *.gradle files. After this, new changes to *.gradle files will fail to build if not in good format, just like checkStyle failure.
2018-06-04core: update opencensus to 0.12.3. (#4530)Bogdan Drutu
Changed calls to deprecated methods to the newly added methods.
2018-05-24Propagate CallCredentials.ATTR_SECURITY_LEVEL from transportsEric Anderson
Previously no transport provided the key so CallCredentials would always see the security as NONE.
2018-05-21all: TimeProvider to use nanos rather than millisZHANG Dapeng
This is the same practice as #2833
2018-05-14core: partially stabilize Attributes API (#4458)zpencer
Deprecate static builder method, Keys.of(), add a notice of plans to remove keys(), emphasize that the name is only a debug label. The `@ExperimentalAPI` is left on the class because there are still issues around hashCode/equals.
2018-05-03 all: normalize copyright header Carl Mastrangelo
2018-04-30 testing: GrpcCleanupRuleZHANG Dapeng
This will ease a lot of test scenarios that we want to automatically shut down servers and channels, with much more flexibility than `GrpcServerRule`. Resolves #3624 **ManagedChannel/Server cleanup details:** - If the test has already failed, call `shutdownNow()` for each of the resources registered. Throw (an exception including) the original failure. End. - If the test is successful, call `shutdown()` for each of the resources registered. - Call `awaitTermination()` with `timeout = deadline - current time` and assert termination for each resource. If any error occurs, break immediately and call `shutdownNow()` for the current resource and all the rest resources. - Throw the first exception encountered if any.
2018-04-12core: always call StreamTracer.streamClosed() when stream is officially ↵Kun Zhang
closed. (#4331) Previously StreamTracer.streamClosed() is called in ServerStream.close(), but it is not exactly when the stream is officially closed. ServerStreamListener.closed() is guaranteed to be called and it is the official end of the stream.
2018-03-30core,netty,okhttp,services: expose socket options to channelz (#4228)zpencer
For okhttp, expose the standard options from the Socket object. For netty, expose all the `io.netty.channel.ChannelOption`s of the `channel.config()`.
2018-03-23Marking GrpcServerRule as finalAmit Desai
Resolves #4239
2018-03-23netty,okhttp,testing: always set TRANSPORT_ATTR_REMOTE_ADDR (#4217)zpencer
Always set the remote address, no reason why this should be a TLS-only feature. This is needed for channelz, and is especially useful in unit tests where we are using plaintext. This PR adds the attr for plaintext.
2018-03-23netty: Add support for ConscryptEric Anderson
2018-03-13testing: temporarily disable socketStats_addresses test (#4216)zpencer
Hardcoding 127.0.0.1 leads to failure in ipv6
2018-03-12core,netty,okhttp: Transparent retryZHANG Dapeng
Changes: - `ClientStreamListener.onClose(Status status, RpcProgress rpcProgress, Metadata trailers)` added. - `AbstractClientStream.transportReportStatus(Status status, RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers)` added - `ClientCallImpl.ClientStreamListenerImpl` will ignore the arg `rpcProgress` (non retry) - `RetriableStream.SubListener` will handle `rpcProgress` and decide if transparent retry. - `NettyClientHandler` and `OkHttpClientTransport` will pass `RpcProgress.REFUSED` to client stream listener for later stream ids when received GOAWAY, or for stream received a RST_STREAM frame with REFUSED code. - All other files are just a result of refactoring.
2018-03-08core,netty,okhttp,testing: separate local vs remote stream start times for ↵zpencer
channelz (#4194) The channelz spec states that the two must be separate.
2018-03-08core,netty,okhttp,testing: nest TransportStats inside SocketStats for ↵zpencer
channelz (#4190) Transport ststistics should really be a child member of SocketStats. While we're at it, let's add the local and remote SocketAddress to SocketStats, with a test.
2018-01-29core: delete outboundMessage() and inboundMessage() on StreamTracer. (#4014)Kun Zhang
They were deprecated in 1.7.0.
2018-01-26core,testing: deprecate passing ServerCall to StatsTraceContext (#3912)zpencer
Instead, pass a ServerCallInfo object containing the interesting bits of info. This lets us modify the call handler for binary logging, but still provide the original info to the StatsTraceContext API.
2018-01-26Update opencensus to 0.11.0 and remove extra dependencies.Bogdan Drutu
2018-01-25core: move ChannelStats and TransportStats to io.grpc.internal.Channelz (#4008)zpencer
2018-01-08Enable the Guava Beta CheckerEric Anderson
2017-12-20Revert "testing: delete deprecated StreamRecorder" (#3801)ZHANG Dapeng
This reverts commit dc71083ce913152763e86ffbc79a78e88b6f04a3. StreamRecorder is too old and may have users unable to migrate it out easily soon.
2017-12-13core: InternalInstrumented<T> for instrumented classes (#3817)zpencer
Entities that report stats to channelz will implement this interface.
2017-11-30core,netty,okhttp: move TransportTracer.Stats to io.grpc (#3812)zpencer
io.grpc can not refer to io.grpc.internal so this needs to be moved out.
2017-11-22testing: Remove DeadlineSubjectEric Anderson
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-22testing: add testing package to javadocZHANG Dapeng
2017-11-22testing: delete some deprecated APIs in TestUtilsdapengzhang0
2017-11-22testing: delete deprecated StreamRecorderdapengzhang0
2017-11-22testing: delete deprecated NoopClientCall and NoopServerCalldapengzhang0
2017-11-22testing: remove deprecated noopMethodDescriptordapengzhang0
2017-11-20testing: bazel build targetsSteve Conover
Adds necessary dependencies and bazel build rules to create `@grpc_java//testing`.
2017-11-13core,netty: plumb fake clock into transport tracer tests (#3724)zpencer
2017-11-10core: record RPC upstarts to Census. (#3708)Kun Zhang
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-10core,netty: wire TransportTracer to netty client (#3705)zpencer
2017-11-08core,netty: correctly count streams that ended due to client cancel (#3683)zpencer
Only bump the counter from AbstractServerStream.TransportState, and hole punch from AbstractServerStream to TransportState when the application calls close.
2017-11-07core: use new OpenCensus stats/tagging API. (#3647)sebright
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-02testing: add TlsTesting.loadCertZHANG Dapeng
2017-11-02netty,core: add a TransportTracer class (#3454)zpencer
2017-11-02Allow tests to run on IPv6-less machinesEric Anderson
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-01testing: move TestUtils.recordServerCallInterceptor internalZHANG Dapeng
2017-11-01testing: move io.grpc.testing.StreamRecorder to internalZHANG Dapeng