@@ -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 ( ) => {
@@ -618,4 +619,28 @@ describe('Experimental Service', () => {
618
619
619
620
client . close ( ) ;
620
621
} ) ;
622
+ describe ( "load balancing configuration" , ( ) => {
623
+ it ( "can use round-robin load balancing" , async ( ) => {
624
+ const { promises : client } = NewClient (
625
+ generateTestToken ( 'v1-promise-namespace' ) ,
626
+ 'localhost:50051' ,
627
+ ClientSecurity . INSECURE_LOCALHOST_ALLOWED ,
628
+ PreconnectServices . SCHEMA_SERVICE ,
629
+ { 'grpc.service_config' : JSON . stringify ( {
630
+ loadBalancingConfig : [ { round_robin : { } } ] ,
631
+ } ) }
632
+ ) ;
633
+
634
+ const schemaResponse = await client . writeSchema ( {
635
+ schema : `definition test/user {}
636
+
637
+ definition test/document {
638
+ relation viewer: test/user
639
+ permission view = viewer
640
+ }
641
+ ` ,
642
+ } ) ;
643
+ expect ( schemaResponse ) . toBeTruthy ( ) ;
644
+ } )
645
+ } )
621
646
} ) ;
0 commit comments