ugly workaround to fix the tests (#2080)

* ugly workaround to fix the tests

* add comments

---------

Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
This commit is contained in:
Manuel Sabban 2023-02-28 17:05:11 +01:00 committed by GitHub
parent 39a4a256fd
commit 60b3f63851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,6 +196,10 @@ func shutdown(sig os.Signal, cConfig *csconfig.Config) error {
} }
func drainChan(c chan types.Event) { func drainChan(c chan types.Event) {
time.Sleep(500 * time.Millisecond)
// delay to avoid draining chan before the acquisition/parser
// get a chance to push its event
// We should close the chan on the writer side rather than this
for { for {
select { select {
case _, ok := <-c: case _, ok := <-c: