Skip to content

Commit ca97954

Browse files
committed
Changes from testing in local environment
1 parent 2ba15f8 commit ca97954

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

cache/__tests__/cache-metrics-worst-case.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,11 @@ test_delete_endpoint() {
751751
# Extract just the ID portion for the delete endpoint
752752
local obj_id=$(echo "$test_id" | sed 's|.*/||')
753753

754+
# Skip if obj_id is invalid
755+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
756+
continue
757+
fi
758+
754759
# Measure ONLY the delete operation
755760
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete object" true 60)
756761
local time=$(echo "$result" | cut -d'|' -f1)
@@ -801,6 +806,11 @@ test_delete_endpoint() {
801806
# Extract just the ID portion for the delete endpoint
802807
local obj_id=$(echo "$test_id" | sed 's|.*/||')
803808

809+
# Skip if obj_id is invalid
810+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
811+
continue
812+
fi
813+
804814
# Measure ONLY the delete operation
805815
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete object" true 60)
806816
local time=$(echo "$result" | cut -d'|' -f1)
@@ -2165,6 +2175,12 @@ test_delete_endpoint_empty() {
21652175
local total=0 success=0
21662176
for i in $(seq 0 $((NUM_ITERATIONS - 1))); do
21672177
local obj_id=$(echo "${CREATED_IDS[$i]}" | sed 's|.*/||')
2178+
2179+
# Skip if obj_id is invalid
2180+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
2181+
continue
2182+
fi
2183+
21682184
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete" true 60)
21692185
local time=$(echo "$result" | cut -d'|' -f1)
21702186
[ "$(echo "$result" | cut -d'|' -f2)" == "204" ] && { total=$((total + time)); success=$((success + 1)); }
@@ -2199,6 +2215,12 @@ test_delete_endpoint_full() {
21992215
for i in $(seq $start_idx $((start_idx + NUM_ITERATIONS - 1))); do
22002216
iteration=$((iteration + 1))
22012217
local obj_id=$(echo "${CREATED_IDS[$i]}" | sed 's|.*/||')
2218+
2219+
# Skip if obj_id is invalid
2220+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
2221+
continue
2222+
fi
2223+
22022224
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete" true 60)
22032225
local time=$(echo "$result" | cut -d'|' -f1)
22042226
[ "$(echo "$result" | cut -d'|' -f2)" == "204" ] && { total=$((total + time)); success=$((success + 1)); }

cache/__tests__/cache-metrics.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,11 @@ test_delete_endpoint() {
770770
# Extract just the ID portion for the delete endpoint
771771
local obj_id=$(echo "$test_id" | sed 's|.*/||')
772772

773+
# Skip if obj_id is invalid
774+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
775+
continue
776+
fi
777+
773778
# Measure ONLY the delete operation
774779
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete object" true 60)
775780
local time=$(echo "$result" | cut -d'|' -f1)
@@ -820,6 +825,11 @@ test_delete_endpoint() {
820825
# Extract just the ID portion for the delete endpoint
821826
local obj_id=$(echo "$test_id" | sed 's|.*/||')
822827

828+
# Skip if obj_id is invalid
829+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
830+
continue
831+
fi
832+
823833
# Measure ONLY the delete operation
824834
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete object" true 60)
825835
local time=$(echo "$result" | cut -d'|' -f1)
@@ -2168,6 +2178,12 @@ test_delete_endpoint_empty() {
21682178
local total=0 success=0
21692179
for i in $(seq 0 $((NUM_ITERATIONS - 1))); do
21702180
local obj_id=$(echo "${CREATED_IDS[$i]}" | sed 's|.*/||')
2181+
2182+
# Skip if obj_id is invalid
2183+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
2184+
continue
2185+
fi
2186+
21712187
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete" true 60)
21722188
local time=$(echo "$result" | cut -d'|' -f1)
21732189
[ "$(echo "$result" | cut -d'|' -f2)" == "204" ] && { total=$((total + time)); success=$((success + 1)); }
@@ -2198,6 +2214,12 @@ test_delete_endpoint_full() {
21982214
for i in $(seq $start_idx $((start_idx + NUM_ITERATIONS - 1))); do
21992215
iteration=$((iteration + 1))
22002216
local obj_id=$(echo "${CREATED_IDS[$i]}" | sed 's|.*/||')
2217+
2218+
# Skip if obj_id is invalid
2219+
if [ -z "$obj_id" ] || [ "$obj_id" == "null" ]; then
2220+
continue
2221+
fi
2222+
22012223
local result=$(measure_endpoint "${API_BASE}/api/delete/${obj_id}" "DELETE" "" "Delete" true 60)
22022224
local time=$(echo "$result" | cut -d'|' -f1)
22032225
[ "$(echo "$result" | cut -d'|' -f2)" == "204" ] && { total=$((total + time)); success=$((success + 1)); }

0 commit comments

Comments
 (0)