@@ -21,6 +21,7 @@ import {
2121 WriteSchemaRequest ,
2222} from "./v1.js" ;
2323import { describe , it , expect , beforeEach } from "vitest" ;
24+ import { PreconnectServices } from "./util.js" ;
2425
2526describe ( "a check with an unknown namespace" , ( ) => {
2627 it ( "should raise a failed precondition" , async ( ) => {
@@ -623,4 +624,30 @@ describe("Experimental Service", () => {
623624
624625 client . close ( ) ;
625626 } ) ;
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+ } ) ;
626653} ) ;
0 commit comments