Files
Pulse/scripts/make-tests-safe.sh
Pulse Monitor 87fc4f651e fix: improve node disk stats reliability when GetNodeStatus fails (addresses #402)
- Ensure disk metrics from /nodes endpoint are preserved when GetNodeStatus fails
- Add better fallback logic to prevent showing 0% or '-' for disk usage
- Improve logging to distinguish between rootfs and /nodes endpoint metrics
- Handle cases where neither rootfs nor valid node disk data is available

This fixes the regression introduced in v4.12.1 where disk stats would show as
'-' when GetNodeStatus failed due to network issues or rate limiting
2025-08-31 22:43:32 +00:00

18 lines
812 B
Bash
Executable File

#!/bin/bash
# This script updates test scripts to use unique test node names
# to prevent collision with user nodes
echo "Making test scripts safe by using unique test node names..."
# Add timestamp to test node names to make them unique
TIMESTAMP=$(date +%s)
# Update test-config-validation.sh to use unique names
sed -i "s/\"name\":\"test\"/\"name\":\"test-val-$TIMESTAMP\"/g" /opt/pulse/scripts/test-config-validation.sh
sed -i "s/\"name\":\"duplicate-test\"/\"name\":\"dup-test-$TIMESTAMP\"/g" /opt/pulse/scripts/test-config-validation.sh
sed -i "s/\"name\":\"pbs-test\"/\"name\":\"pbs-test-$TIMESTAMP\"/g" /opt/pulse/scripts/test-config-validation.sh
echo "Test scripts updated with unique node names (suffix: $TIMESTAMP)"
echo ""
echo "You can now safely run tests without affecting production nodes!"