mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-04 03:05:13 +00:00
test: ensure consistency of TestSpooler_awaitError (#3750)
This commit is contained in:
parent
233d80502d
commit
ace94917da
@ -224,12 +224,17 @@ func TestSpooler_awaitError(t *testing.T) {
|
|||||||
s := &spooledHandler{
|
s := &spooledHandler{
|
||||||
Handler: tt.fields.currentHandler,
|
Handler: tt.fields.currentHandler,
|
||||||
}
|
}
|
||||||
|
c := make(chan interface{})
|
||||||
errs := make(chan error)
|
errs := make(chan error)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
|
||||||
go s.awaitError(cancel, errs, "test")
|
go func() {
|
||||||
|
s.awaitError(cancel, errs, "test")
|
||||||
|
c <- nil
|
||||||
|
}()
|
||||||
errs <- tt.fields.err
|
errs <- tt.fields.err
|
||||||
|
|
||||||
|
<-c
|
||||||
if ctx.Err() == nil {
|
if ctx.Err() == nil {
|
||||||
t.Error("cancel function was not called")
|
t.Error("cancel function was not called")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user