On 2025-05-13 18:41, alison.schofi...@intel.com wrote:
> From: Alison Schofield <alison.schofi...@intel.com>
> 
> monitor.sh runs for 50 seconds and spends 48 of those seconds sleeping.
> Removing the sleeps entirely has no effect on the test in this users
> environment. It passes and produces the same test log.
> 
> Experiments replacing sleeps with polling for monitor ready and log file
> updates proved that both are always available following the sync so there
> is no need to replace the sleeps with a more precise or reliable polling
> method. Simply remove the sleeps. Run time is now < 3s.
> 
> I'd especially like to get Tested-by tags on this one to confirm that my
> environment isn't special and that this succeeds elsewhere.

In my configuration, this patch makes the test fail 100% of the time.
It passes 100% of the time without this patch.

Also, it leaves a "ndctl monitor" behind which makes meson hang
forever, believing the test is never done.

Tested on top of current "origin/pending" 1850ddcbcbf9

Marc

nmem6: supported alarms: 0x7
nmem6: set spare threshold: 99
libndctl: do_cmd: bus: 2 dimm: 0x100 cmd: cmd_call:smart_set_thresh status: 0 
fw: 0 (success)
nmem6: set mtemp threshold: 11.50
libndctl: do_cmd: bus: 2 dimm: 0x100 cmd: cmd_call:smart_set_thresh status: 0 
fw: 0 (success)
nmem6: set ctemp threshold: 12.50
libndctl: do_cmd: bus: 2 dimm: 0x100 cmd: cmd_call:smart_set_thresh status: 0 
fw: 0 (success)
nmem6: set thresholds back to defaults
libndctl: do_cmd: bus: 2 dimm: 0x100 cmd: cmd_call:smart_set_thresh status: 0 
fw: 0 (success)
libdaxctl: daxctl_unref: context 0x56469566a9d0 released
libndctl: ndctl_unref: context 0x56469566b050 released
+ sync
+ check_result 'nmem4 nmem5 nmem6 nmem7'
++ cat /tmp/tmp.mYY263Hk3f
+ jlog=
++ jq .dimm.dev
++ sort
++ uniq
++ xargs
+ notify_dimms=
+ [[ nmem4 nmem5 nmem6 nmem7 == '' ]]
++ err 65
+++ basename /root/CXL/ndctl/test/monitor.sh
++ echo test/monitor.sh: failed at line 65
test/monitor.sh: failed at line 65
++ '[' -n '' ']'
++ exit 1



> Signed-off-by: Alison Schofield <alison.schofi...@intel.com>
> ---
>  test/monitor.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/test/monitor.sh b/test/monitor.sh
> index be8e24d6f3aa..88e253e5df00 100755
> --- a/test/monitor.sh
> +++ b/test/monitor.sh
> @@ -26,7 +26,7 @@ start_monitor()
>       logfile=$(mktemp)
>       $NDCTL monitor -c "$monitor_conf" -l "$logfile" $1 &
>       monitor_pid=$!
> -     sync; sleep 3
> +     sync
>       truncate --size 0 "$logfile" #remove startup log
>  }
>  
> @@ -49,13 +49,13 @@ get_monitor_dimm()
>  call_notify()
>  {
>       "$TEST_PATH"/smart-notify "$smart_supported_bus"
> -     sync; sleep 3
> +     sync
>  }
>  
>  inject_smart()
>  {
>       $NDCTL inject-smart "$monitor_dimms" $1
> -     sync; sleep 3
> +     sync
>  }
>  
>  check_result()


Reply via email to