mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-18 19:47:22 +02:00
Fix many instances of contexts and loggers not being propagated (#5340)
This also replaces instances where we manually write "return ctx.Err()" with "return context.Cause(ctx)" which is functionally identical, but will also correctly propagate cause errors if present.
This commit is contained in:
parent
e1880ba20f
commit
fe31799eb5
77 changed files with 297 additions and 221 deletions
|
@ -42,7 +42,7 @@ func TestRegistry(t *testing.T) {
|
|||
defer clearTimeout()
|
||||
|
||||
require.NoError(t, testutil.WithTestPostgres(func(dsn string) error {
|
||||
backend := New(dsn)
|
||||
backend := New(ctx, dsn)
|
||||
defer backend.Close()
|
||||
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
|
@ -53,7 +53,7 @@ func TestRegistry(t *testing.T) {
|
|||
send: func(res *registry.ServiceList) error {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
return context.Cause(ctx)
|
||||
case listResults <- res:
|
||||
}
|
||||
return nil
|
||||
|
@ -73,7 +73,7 @@ func TestRegistry(t *testing.T) {
|
|||
eg.Go(func() error {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
return context.Cause(ctx)
|
||||
case res := <-listResults:
|
||||
testutil.AssertProtoEqual(t, ®istry.ServiceList{}, res)
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ func TestRegistry(t *testing.T) {
|
|||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
return context.Cause(ctx)
|
||||
case res := <-listResults:
|
||||
testutil.AssertProtoEqual(t, ®istry.ServiceList{
|
||||
Services: []*registry.Service{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue