mirror of
https://github.com/moby/moby.git
synced 2026-08-03 22:51:03 +00:00
integration: Don't env cleanup before parallel subtests
Calling function returned from setupTest (which calls testEnv.Clean) in
a defer block inside a test that spawns parallel subtests caused the
cleanup function to be called before any of the subtest did anything.
Change the defer expressions to use `t.Cleanup` instead to call it only
after all subtests have also finished.
This only changes tests which have parallel subtests.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit f9e2eed55d)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -32,7 +32,7 @@ import (
|
||||
// TestPluginInvalidJSON tests that POST endpoints that expect a body return
|
||||
// the correct error when sending invalid JSON requests.
|
||||
func TestPluginInvalidJSON(t *testing.T) {
|
||||
defer setupTest(t)()
|
||||
t.Cleanup(setupTest(t))
|
||||
|
||||
// POST endpoints that accept / expect a JSON body;
|
||||
endpoints := []string{
|
||||
|
||||
Reference in New Issue
Block a user