Revert changes in tests

This commit is contained in:
Krzysztof Dąbrowski 2024-03-30 20:46:23 +01:00
parent 5e94ffe90b
commit 170d143b1a
No known key found for this signature in database
2 changed files with 17 additions and 3 deletions

View File

@ -75,11 +75,11 @@ const (
// updateMaxRetries is the max retries for a failed node
updateMaxRetries = 10
// nodePollInterval is used in listing node
nodePollInterval = 10 * time.Second
)
// nodePollInterval is used in listing node
var nodePollInterval = 10 * time.Second
// CIDRAllocator is an interface implemented by things that know how
// to allocate/occupy/recycle CIDR for nodes.
type CIDRAllocator interface {

View File

@ -292,6 +292,13 @@ func TestOccupyPreExistingCIDR(t *testing.T) {
}
func TestAllocateOrOccupyCIDRSuccess(t *testing.T) {
// Non-parallel test (overrides global var)
oldNodePollInterval := nodePollInterval
nodePollInterval = test.NodePollInterval
defer func() {
nodePollInterval = oldNodePollInterval
}()
// all tests operate on a single node
testCases := []testCase{
{
@ -673,6 +680,13 @@ type releaseTestCase struct {
}
func TestReleaseCIDRSuccess(t *testing.T) {
// Non-parallel test (overrides global var)
oldNodePollInterval := nodePollInterval
nodePollInterval = test.NodePollInterval
defer func() {
nodePollInterval = oldNodePollInterval
}()
testCases := []releaseTestCase{
{
description: "Correctly release preallocated CIDR",