mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-09 23:48:24 +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() {
|
||||
timeout := 10 * time.Second
|
||||
if err = container.Stop(ctx, &timeout); err != nil {
|
||||
log.WithContext(ctx).Warnf("failed to stop container: %s", err)
|
||||
if err = container.Terminate(ctx); err != nil {
|
||||
log.WithContext(ctx).Warnf("failed to terminate container: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,9 +71,8 @@ func CreatePostgresTestContainer() (func(), error) {
|
||||
}
|
||||
|
||||
cleanup := func() {
|
||||
timeout := 10 * time.Second
|
||||
if err = container.Stop(ctx, &timeout); err != nil {
|
||||
log.WithContext(ctx).Warnf("failed to stop container: %s", err)
|
||||
if err = container.Terminate(ctx); err != nil {
|
||||
log.WithContext(ctx).Warnf("failed to terminate container: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user