mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-25 07:19:05 +01:00
Terminate tests containers on defer instead of waiting
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
parent
80d1bed9ce
commit
3f30eb7692
@ -40,9 +40,8 @@ func CreateMysqlTestContainer() (func(), error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup := func() {
|
cleanup := func() {
|
||||||
timeout := 10 * time.Second
|
if err = container.Terminate(ctx); err != nil {
|
||||||
if err = container.Stop(ctx, &timeout); err != nil {
|
log.WithContext(ctx).Warnf("failed to terminate container: %s", err)
|
||||||
log.WithContext(ctx).Warnf("failed to stop container: %s", err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,9 +71,8 @@ func CreatePostgresTestContainer() (func(), error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup := func() {
|
cleanup := func() {
|
||||||
timeout := 10 * time.Second
|
if err = container.Terminate(ctx); err != nil {
|
||||||
if err = container.Stop(ctx, &timeout); err != nil {
|
log.WithContext(ctx).Warnf("failed to terminate container: %s", err)
|
||||||
log.WithContext(ctx).Warnf("failed to stop container: %s", err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user