Allow test to handle both RPCErrorKind.kConnectionDisposed and kServerError codes. These codes can be thrown if the VM shuts down before the service can send its response

Fixes https://github.com/dart-lang/sdk/issues/56909

Change-Id: I8a0a9328f2342811a6c230712c8b908bbd7d828c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396120
Auto-Submit: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Jessy Yameogo
2024-11-18 20:45:45 +00:00
committed by Commit Queue
parent 6e8180a40b
commit 9e0f1840c3
+5 -1
View File
@@ -22,7 +22,11 @@ final tests = <IsolateTest>[
// There's a good chance `kill()` will throw due to the VM shutting down.
// If an RPCError is thrown, make sure it's actually because the VM
// service connection has disappeared.
expect(e.code, RPCErrorKind.kConnectionDisposed.code);
expect(
[RPCErrorKind.kConnectionDisposed.code, RPCErrorKind.kServerError.code]
.contains(e.code),
true,
);
}
}
];