soap_work
03/27/2023, 6:38 AMtestcontainers
fixtures. Specifically, previously I was waiting only for the first registered port (the GRPC port in this case) to start listening before starting tests. This was inadequate: spicedb was NOT ready for reasons I don't understand (nor can I be bothered finding out). Instead, I used a log tailing wait strategy and specified a wait for the server to emit the 'http server started serving' string (I am obviously also enabling the http server under test) and this has resolved my woes: I only get GRPC communication issues now if I do something stupid/intentionally bad like nuking spicedb.Perseus
03/27/2023, 8:15 AMjs
const container = new GenericContainer('authzed/spicedb:v1.14.0')
.withExposedPorts(
{
container: 50051,
host: 50051,
},
{
container: 50052,
host: 50052,
},
)
.withCopyFilesToContainer([
{
source: 'src/others/schema.yaml',
target: '/etc/schema.yaml',
},
])
.withWaitStrategy(new LogWaitStrategy('started serving'))
.withEntrypoint([
'spicedb',
'serve-testing',
'--load-configs',
'/etc/schema.yaml',
]);
for some reason the default waitstrategy wouldn't workRaza
04/18/2023, 10:35 PMSaturas
04/19/2023, 6:30 PMconst container = new GenericContainer('authzed/spicedb:v1.14.0')
.withExposedPorts(
{
container: 50051,
host: 50051,
},
{
container: 50052,
host: 50052,
},
)
.withCopyFilesToContainer([
{
** source: 'src/others/schema.yaml',
target: '/etc/schema.yaml',**
},
])
.withWaitStrategy(new LogWaitStrategy('started serving'))
.withEntrypoint([
'spicedb',
'serve-testing',
** '--load-configs',
'/etc/schema.yaml',**
]);
val schema = readSchemaFromResource()
val request = WriteSchemaRequest.newBuilder().setSchema(schema).build()
val response = schemaService.writeSchema(request)