Skip to content

Commit bdfd1fa

Browse files
committed
fix: upgrade_test on local
1 parent abd6001 commit bdfd1fa

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

crates/fluvio-spu/src/core/metrics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ pub(crate) struct Record {
4242

4343
impl Record {
4444
pub(crate) fn increase(&self, records: u64, bytes: u64) {
45-
self.records.fetch_add(records, Ordering::SeqCst);
46-
self.bytes.fetch_add(bytes, Ordering::SeqCst);
45+
self.records.fetch_add(records, Ordering::Relaxed);
46+
self.bytes.fetch_add(bytes, Ordering::Relaxed);
4747
}
4848
}
4949

crates/fluvio/src/metrics/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,12 @@ cfg_if::cfg_if! {
6565
}
6666

6767
impl RecordCounter {
68-
#[inline]
6968
pub(crate) fn add_records(&self, value: u64) {
70-
self.records.fetch_add(value, Ordering::SeqCst);
69+
self.records.fetch_add(value, Ordering::Relaxed);
7170
}
7271

73-
#[inline]
7472
pub(crate) fn add_bytes(&self, value: u64) {
75-
self.bytes.fetch_add(value, Ordering::SeqCst);
73+
self.bytes.fetch_add(value, Ordering::Relaxed);
7674
}
7775
}
7876

makefiles/build.mk

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ ifeq (${CI},true)
4848
build_k8_image:
4949
else ifeq (${IMAGE_VERSION},true)
5050
build_k8_image:
51+
else ifeq (${FLUVIO_MODE},local)
52+
build_k8_image:
5153
else
5254
# When not in CI (i.e. development), build image before testing
5355
build_k8_image: fluvio_image

tests/upgrade-test.sh

+12-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ function cleanup() {
5252
# If we're in CI, we want to slow down execution
5353
# to give CPU some time to rest, so we don't time out
5454
function ci_check() {
55-
:
55+
if [[ "$FLUVIO_MODE" == "local" ]]; then
56+
sleep $CI_SLEEP
57+
else
58+
:
59+
fi
5660
}
5761

5862
# This function is intended to be run second after the Stable-1 validation
@@ -104,6 +108,7 @@ function validate_cluster_stable() {
104108
# https://github.com/infinyon/fluvio/issues/1819
105109
echo "Validate consume on \"${STABLE_TOPIC}\" before producing"
106110
$STABLE_FLUVIO consume -B -d ${STABLE_TOPIC} 2>/dev/null
111+
ci_check;
107112

108113
echo "Producing test data to ${STABLE_TOPIC}"
109114
cat data1.txt.tmp | $STABLE_FLUVIO produce ${STABLE_TOPIC}
@@ -128,6 +133,7 @@ function validate_cluster_stable() {
128133

129134

130135
$STABLE_FLUVIO partition list
136+
ci_check;
131137

132138
}
133139

@@ -151,7 +157,7 @@ function validate_upgrade_cluster_to_prerelease() {
151157
~/.fvm/bin/fvm install latest | tee /tmp/installer.output
152158
# expectd output fvm current => 0.11.0-dev-1+hash (latest)
153159
DEV_VERSION=$(~/.fvm/bin/fvm current | awk '{print $1}')
154-
TARGET_VERSION=${PRERELEASE:0:${#PRERELEASE}-41}
160+
TARGET_VERSION=${DEV_VERSION:0:${#DEV_VERSION}-41}
155161

156162
echo "Installed CLI version ${DEV_VERSION}"
157163
echo "Upgrading cluster to ${DEV_VERSION}"
@@ -172,17 +178,18 @@ function validate_upgrade_cluster_to_prerelease() {
172178
fi
173179
if [[ "$FLUVIO_MODE" == "local" ]]; then
174180
echo "Resuming local cluster"
175-
sleep 5
176181
$FLUVIO_BIN_ABS_PATH cluster resume
177182
fi
178183
popd
179184

185+
ci_check;
180186

181187
# Validate that the development version output matches the expected version from installer output
182188
$FLUVIO_BIN_ABS_PATH version
183189
validate_cli_version $FLUVIO_BIN_ABS_PATH $TARGET_VERSION
184190
validate_platform_version $FLUVIO_BIN_ABS_PATH $TARGET_VERSION
185191

192+
ci_check;
186193

187194
echo "Create test topic: ${PRERELEASE_TOPIC}"
188195
$FLUVIO_BIN_ABS_PATH topic create ${PRERELEASE_TOPIC}
@@ -324,6 +331,8 @@ function main() {
324331
echo "Update cluster to stable v${STABLE}. Create and validate data."
325332
validate_cluster_stable;
326333

334+
ci_check;
335+
327336
echo "Update cluster to prerelease v${PRERELEASE}"
328337
validate_upgrade_cluster_to_prerelease;
329338

0 commit comments

Comments
 (0)