Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eni/node_manager_test: Add set up and tear down
In this test suite, the `metricsapi` is global variable which is shared among all the `Test*` functions. It is possible that it becomes polluted over time during test execution. This is an attempt to resolve the following: ``` FAIL: node_manager_test.go:563: ENISuite.TestNodeManagerManyNodes node_manager_test.go:602: c.Errorf("Node %s allocation mismatch. expected: %d allocated: %d", s.name, minAllocate, node.Stats().AvailableIPs) ... Error: Node node53 allocation mismatch. expected: 10 allocated: 18 node_manager_test.go:602: c.Errorf("Node %s allocation mismatch. expected: %d allocated: %d", s.name, minAllocate, node.Stats().AvailableIPs) ... Error: Node node59 allocation mismatch. expected: 10 allocated: 18 node_manager_test.go:617: c.Assert(metricsapi.AllocatedIPs("available"), check.Equals, numNodes*minAllocate) ... obtained int = 1016 ... expected int = 1000 ... OOPS: 17 passed, 1 FAILED --- FAIL: Test (2.60s) FAIL coverage: 4.3% of statements in ./... FAIL github.com/cilium/cilium/pkg/aws/eni 2.684s FAIL Makefile:204: recipe for target 'unit-tests' failed make: *** [unit-tests] Error 1 The command "./.travis/build.sh" exited with 2. ``` Signed-off-by: Chris Tarazi <chris@isovalent.com>
- Loading branch information