Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Sep 2, 2024
1 parent 4f6fe9b commit 209ffb3
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ jobs:
- name: Run tests
run: dart test --platform ${{ matrix.platform }}
- name: Run vmservice test
if: ${{ matrix.platform != 'chrome' && false }} #Disable until https://github.com/grpc/grpc-dart/issues/697 is resolved
if: ${{ matrix.platform != 'chrome' }}
run: dart run --enable-vm-service --timeline-streams=Dart test/timeline_test.dart
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The [Dart](https://www.dart.dev/) implementation of
## Learn more

- [Quick Start](https://grpc.io/docs/languages/dart/quickstart) - get an app running in minutes
- [Examples](example)
- [Examples](https://github.com/grpc/grpc-dart/tree/master/example)
- [API reference](https://grpc.io/docs/languages/dart/api)

For complete documentation, see [Dart gRPC](https://grpc.io/docs/languages/dart).
Expand Down
2 changes: 1 addition & 1 deletion lib/src/client/http2_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Http2ClientConnection implements connection.ClientConnection {
transport.ping();
}
},
onPingTimeout: () => shutdown(),
onPingTimeout: () => transport.finish(),
);
transport.onFrameReceived
.listen((_) => keepAliveManager?.onFrameReceived());
Expand Down
2 changes: 1 addition & 1 deletion test/client_tests/client_xhr_transport_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class MockHttpRequest extends Mock implements HttpRequest {
class MockXhrClientConnection extends XhrClientConnection {
MockXhrClientConnection({int? code})
: _statusCode = code ?? 200,
super(Uri.parse('test:8080'));
super(Uri.parse('test:0'));

late MockHttpRequest latestRequest;
final int _statusCode;
Expand Down
2 changes: 1 addition & 1 deletion test/client_tests/grpc_or_grpcweb_channel_grpc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'package:grpc/grpc_or_grpcweb.dart';
import 'package:test/test.dart';

const host = 'example.com';
const port = 8080;
const port = 0;

void main() {
test('Channel on non-web uses gRPC ClientChannel with correct params', () {
Expand Down
2 changes: 1 addition & 1 deletion test/client_tests/grpc_or_grpcweb_channel_web_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'package:grpc/grpc_web.dart';
import 'package:test/test.dart';

const host = 'example.com';
const port = 8080;
const port = 0;

void main() {
test('Channel on web uses GrpcWebClientChannel with correct URI', () {
Expand Down
4 changes: 2 additions & 2 deletions test/proxy_secure_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ void main() {
server = Server.create(services: [FakeEchoService()]);
await server.serve(
address: 'localhost',
port: 8888,
port: 0,
security: ServerTlsCredentials(
certificate: File('test/data/localhost.crt').readAsBytesSync(),
privateKey: File('test/data/localhost.key').readAsBytesSync(),
),
);
final proxy = Proxy(host: 'localhost', port: 8080);
final proxy = Proxy(host: 'localhost', port: 0);
final proxyCAName = '/CN=mitmproxy/O=mitmproxy';

fakeChannel = ClientChannel(
Expand Down
4 changes: 2 additions & 2 deletions test/proxy_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ void main() {

setUp(() async {
server = Server.create(services: [FakeEchoService()]);
await server.serve(address: 'localhost', port: 8888);
await server.serve(address: 'localhost', port: 0);

final proxy = Proxy(host: 'localhost', port: 8080);
final proxy = Proxy(host: 'localhost', port: 0);

fakeChannel = ClientChannel(
'localhost',
Expand Down
2 changes: 1 addition & 1 deletion test/server_cancellation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void main() {
server = Server.create(
services: [EchoService()],
);
await server.serve(address: 'localhost', port: 8081);
await server.serve(address: 'localhost', port: 0);
channel = ClientChannel(
'localhost',
port: server.port!,
Expand Down
4 changes: 2 additions & 2 deletions test/tools/http2_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import 'package:grpc/src/client/http2_connection.dart';
import 'package:http2/http2.dart';

Future<void> main(List<String> args) async {
final serverPort = 5678;
final serverPort = 0;
final proxyPort = int.tryParse(args.first);

final proxy =
Expand All @@ -37,7 +37,7 @@ Future<void> main(List<String> args) async {
final incoming =
proxy == null ? connector.socket : await connector.connectToProxy(proxy);

final uri = Uri.parse('http://localhost:8080');
final uri = Uri.parse('http://localhost:0');

final transport =
ClientTransportConnection.viaStreams(incoming, connector.socket);
Expand Down

0 comments on commit 209ffb3

Please sign in to comment.