Skip to content

Commit 24b64c6

Browse files
authored
Improve Makefile and add more logs to the velocity tests (#2330)
* Improve Makefile and add more logs to the velocity tests
1 parent f773023 commit 24b64c6

File tree

26 files changed

+269
-239
lines changed

26 files changed

+269
-239
lines changed

controllers/controllers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func processRequeue(
8484
}
8585

8686
if requeue.delay == time.Duration(0) {
87-
requeue.delay = 2 * time.Second
87+
requeue.delay = 100 * time.Millisecond
8888
}
8989

9090
recorder.Event(object, corev1.EventTypeNormal, "ReconciliationTerminatedEarly", requeue.message)

e2e/Makefile

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,26 @@ DEFAULT_UNAVAILABLE_THRESHOLD?=30s
3636
CLOUD_PROVIDER?=
3737
# Multiple versions can be specified for these upgrades by separating them with a, e.g. 6.2.25:7.1.25,7.1.23:7.1.25
3838
UPGRADE_VERSIONS?="$(FDB_VERSION):$(NEXT_FDB_VERSION)"
39-
# Those are feature flags for the operator tests. Enable a feature if you want to run the operator tests with a specific
40-
# feature enabled e.g. like DNS.
41-
FEATURE_DNS?=
42-
FEATURE_LOCALITIES?=
4339
# Allows to specify the tag for a specific FDB version. Format is 7.1.57:7.1.57-testing,7.3.35:7.3.35-debugging
4440
FDB_VERSION_TAG_MAPPING?=
4541
# If the FEATURE_SERVER_SIDE_APPLY environment variable is not defined the test suite will be randomly enable (1) or disable (0)
4642
# the server side apply feature.
4743
ifndef FEATURE_SERVER_SIDE_APPLY
48-
FEATURE_SERVER_SIDE_APPLY=$(shell shuf -i 0-1 -n 1)
44+
ifeq ($(shell shuf -i 0-1 -n 1), 0)
45+
FEATURE_SERVER_SIDE_APPLY=false
46+
else
47+
FEATURE_SERVER_SIDE_APPLY=true
48+
endif
4949
endif
5050

5151
# If the FEATURE_UNIFIED_IMAGE environment variable is not defined the test suite will be randomly enable (1) or disable (0)
5252
# the unified image feature.
5353
ifndef FEATURE_UNIFIED_IMAGE
54-
FEATURE_UNIFIED_IMAGE=$(shell shuf -i 0-1 -n 1)
54+
ifeq ($(shell shuf -i 0-1 -n 1), 0)
55+
FEATURE_UNIFIED_IMAGE=false
56+
else
57+
FEATURE_UNIFIED_IMAGE=true
58+
endif
5559
endif
5660

5761
# If the STORAGE_ENGINE environment variable is not defined the test suite will be randomly choosing between the ssd
@@ -77,6 +81,21 @@ ifndef FEATURE_SYNCHRONIZATION_MODE
7781
endif
7882
endif
7983

84+
ifndef FEATURE_LOCALITIES
85+
ifeq ($(shell shuf -i 0-1 -n 1), 0)
86+
FEATURE_LOCALITIES=false
87+
else
88+
FEATURE_LOCALITIES=true
89+
endif
90+
endif
91+
92+
ifndef FEATURE_DNS
93+
ifeq ($(shell shuf -i 0-1 -n 1), 0)
94+
FEATURE_DNS=false
95+
else
96+
FEATURE_DNS=true
97+
endif
98+
endif
8099
# Make bash pickier about errors.
81100
SHELL=/bin/bash -euo pipefail
82101

@@ -159,14 +178,6 @@ foundationdb-nightly-tests: GINKGO_LABEL_FILTER=--ginkgo.label-filter="foundatio
159178
# Run the actual foundationdb-nightly tests.
160179
foundationdb-nightly-tests: run
161180

162-
ifdef FEATURE_LOCALITIES
163-
FEATURE_LOCALITIES_FLAG=--feature-localities=$(FEATURE_LOCALITIES)
164-
endif
165-
166-
ifdef FEATURE_DNS
167-
FEATURE_DNS_FLAG=--feature-dns=$(FEATURE_DNS)
168-
endif
169-
170181
%.run: %
171182
@sleep $$(shuf -i 1-10 -n 1)
172183
go test -timeout=$(TIMEOUT) $(VERBOSE) ./$< \
@@ -197,7 +208,9 @@ endif
197208
--feature-unified-image=$(FEATURE_UNIFIED_IMAGE) \
198209
--feature-server-side-apply=$(FEATURE_SERVER_SIDE_APPLY) \
199210
--feature-synchronization-mode=$(FEATURE_SYNCHRONIZATION_MODE) \
211+
--feature-dns=$(FEATURE_DNS) \
212+
--feature-localities=$(FEATURE_LOCALITIES) \
200213
--node-selector="$(NODE_SELECTOR)" \
201214
--default-unavailable-threshold=$(DEFAULT_UNAVAILABLE_THRESHOLD) \
202-
--seaweedfs-image=$(SEAWEEDFS_IMAGE) $(FEATURE_LOCALITIES_FLAG) $(FEATURE_DNS_FLAG) \
215+
--seaweedfs-image=$(SEAWEEDFS_IMAGE) \
203216
| grep -v 'constructing many client instances from the same exec auth config can cause performance problems during cert rotation' &> $(BASE_DIR)/../logs/$<.log

e2e/fixtures/cluster_config.go

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/onsi/ginkgo/v2"
3030
corev1 "k8s.io/api/core/v1"
3131
"k8s.io/apimachinery/pkg/api/resource"
32+
"k8s.io/utils/ptr"
3233
)
3334

3435
type cloudProvider string
@@ -54,7 +55,7 @@ const (
5455
)
5556

5657
// GetRedundancyMode returns the redundancy mode based on the cluster configuration.
57-
func (config ClusterConfig) GetRedundancyMode() fdbv1beta2.RedundancyMode {
58+
func (config *ClusterConfig) GetRedundancyMode() fdbv1beta2.RedundancyMode {
5859
if config.RedundancyMode != "" {
5960
return config.RedundancyMode
6061
}
@@ -74,6 +75,8 @@ type ClusterConfig struct {
7475
DebugSymbols bool
7576
// UseMaintenanceMode if enabled the FoundationDBCluster resource will enable the maintenance mode.
7677
UseMaintenanceMode bool
78+
// EnableTLS when set this value will be used to enable/disable TLS, the default is true.
79+
EnableTLS *bool
7780
// UseLocalityBasedExclusions if enabled the FoundationDBCluster resource will enable the locality based exclusions.
7881
UseLocalityBasedExclusions *bool
7982
// UseDNS if enabled the FoundationDBCluster resource will enable the DNS feature.
@@ -109,6 +112,8 @@ type ClusterConfig struct {
109112
Name string
110113
// TLSPeerVerification represents the TLS peer verification that should be used for the cluster.
111114
TLSPeerVerification string
115+
// Version used to create the FDB cluster with.
116+
Version *string
112117
// cloudProvider defines the cloud provider used to create the Kubernetes cluster. This value is set in the SetDefaults
113118
// method.
114119
cloudProvider cloudProvider
@@ -200,6 +205,26 @@ func (config *ClusterConfig) SetDefaults(factory *Factory) {
200205
if config.SynchronizationMode == "" {
201206
config.SynchronizationMode = factory.GetSynchronizationMode()
202207
}
208+
209+
if config.UseDNS == nil {
210+
config.UseDNS = ptr.To(factory.options.featureOperatorDNS)
211+
}
212+
213+
if config.UseLocalityBasedExclusions == nil {
214+
config.UseLocalityBasedExclusions = ptr.To(factory.options.featureOperatorLocalities)
215+
}
216+
217+
if config.EnableTLS == nil {
218+
config.EnableTLS = ptr.To(true)
219+
}
220+
221+
if config.UseUnifiedImage == nil {
222+
config.UseUnifiedImage = ptr.To(factory.UseUnifiedImage())
223+
}
224+
225+
if config.Version == nil {
226+
config.Version = ptr.To(factory.GetFDBVersion().String())
227+
}
203228
}
204229

205230
// getVolumeSize returns the volume size in as a string. If no volume size is defined a default will be set based on
@@ -555,6 +580,21 @@ func (config *ClusterConfig) CalculateRoleCounts() fdbv1beta2.RoleCounts {
555580
return roleCounts
556581
}
557582

583+
// GetUseUnifiedImage returns true when the unified image should be used.
584+
func (config *ClusterConfig) GetUseUnifiedImage() bool {
585+
return ptr.Deref(config.UseUnifiedImage, true)
586+
}
587+
588+
// TLSEnabled returns true when TLS should be enabled or false if TLS should be disabled.
589+
func (config *ClusterConfig) TLSEnabled() bool {
590+
return ptr.Deref(config.EnableTLS, true)
591+
}
592+
593+
// GetVersion returns the version to create the cluster with.
594+
func (config *ClusterConfig) GetVersion() string {
595+
return ptr.Deref(config.Version, "")
596+
}
597+
558598
func calculateProxies(proxies int) (int, int) {
559599
// This calculation is only a rough estimate and can change based on the workload.
560600
// Use 1/4 of the proxies for GRV or at max 4 processes
@@ -590,5 +630,7 @@ func (config *ClusterConfig) Copy() *ClusterConfig {
590630
MemoryPerPod: config.MemoryPerPod,
591631
CpusPerPod: config.CpusPerPod,
592632
SynchronizationMode: config.SynchronizationMode,
633+
EnableTLS: config.EnableTLS,
634+
Version: config.Version,
593635
}
594636
}

0 commit comments

Comments
 (0)