@@ -21,6 +21,7 @@ import {
21
21
WriteSchemaRequest ,
22
22
} from "./v1.js" ;
23
23
import { describe , it , expect , beforeEach } from "vitest" ;
24
+ import { PreconnectServices } from "./util.js" ;
24
25
25
26
describe ( "a check with an unknown namespace" , ( ) => {
26
27
it ( "should raise a failed precondition" , async ( ) => {
@@ -623,4 +624,30 @@ describe("Experimental Service", () => {
623
624
624
625
client . close ( ) ;
625
626
} ) ;
627
+ describe ( "load balancing configuration" , ( ) => {
628
+ it ( "can use round-robin load balancing" , async ( ) => {
629
+ const { promises : client } = NewClient (
630
+ generateTestToken ( "v1-promise-namespace" ) ,
631
+ "localhost:50051" ,
632
+ ClientSecurity . INSECURE_LOCALHOST_ALLOWED ,
633
+ PreconnectServices . SCHEMA_SERVICE ,
634
+ {
635
+ "grpc.service_config" : JSON . stringify ( {
636
+ loadBalancingConfig : [ { round_robin : { } } ] ,
637
+ } ) ,
638
+ } ,
639
+ ) ;
640
+
641
+ const schemaResponse = await client . writeSchema ( {
642
+ schema : `definition test/user {}
643
+
644
+ definition test/document {
645
+ relation viewer: test/user
646
+ permission view = viewer
647
+ }
648
+ ` ,
649
+ } ) ;
650
+ expect ( schemaResponse ) . toBeTruthy ( ) ;
651
+ } ) ;
652
+ } ) ;
626
653
} ) ;
0 commit comments