Skip to content

check-signal-stop-start.sh: report failure when process terminated early - #1000

Merged
marc-hb merged 2 commits into
thesofproject:mainfrom
fredoh9:fix/stop-start-io-error
Feb 2, 2023
Merged

marc-hb merged 2 commits into
thesofproject:mainfrom
fredoh9:fix/stop-start-io-error

Conversation

@fredoh9

@fredoh9 fredoh9 commented Jan 31, 2023

Copy link
Copy Markdown
Contributor

When aplay or arecord process is terminated during the test, while loop condition catches the error first then just return the function. In this case it ends up with a false pass.

Removed the process check from while loop. sof-process-state.sh will do it anyway.

issue link: #988
Signed-off-by: Fred Oh fred.oh@linux.intel.com

@fredoh9
fredoh9 requested a review from a team as a code owner January 31, 2023 20:35
@fredoh9
fredoh9 force-pushed the fix/stop-start-io-error branch from d9266f6 to d561f1d Compare January 31, 2023 21:02

@marc-hb marc-hb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the shellcheck errors first so a quick revert is easy if needed.

Comment thread test-case/check-signal-stop-start.sh Resolved
Comment thread test-case/check-signal-stop-start.sh Resolved
Comment thread test-case/check-signal-stop-start.sh Resolved
Comment thread test-case/check-signal-stop-start.sh Resolved

@marc-hb marc-hb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch BTW: so this test has provided the "ultimate green failure" for many years?

Comment thread test-case/check-signal-stop-start.sh Resolved
@marc-hb marc-hb added False Pass / green failure P1 Blocker bugs or important features bug labels Jan 31, 2023
@fredoh9
fredoh9 force-pushed the fix/stop-start-io-error branch from d561f1d to 9611572 Compare February 1, 2023 01:03
@fredoh9
fredoh9 requested a review from marc-hb February 1, 2023 01:04

@marc-hb marc-hb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

Comment thread test-case/check-signal-stop-start.sh Resolved
Comment thread test-case/check-signal-stop-start.sh Outdated
source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh

OPT_NAME['t']='tplg' OPT_DESC['t']='tplg file, default value is env TPLG: $TPLG'
OPT_NAME['t']='tplg' OPT_DESC['t']="tplg file, default value is env TPLG: $TPLG"

@marc-hb marc-hb Feb 1, 2023 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-h already shows the default value (please try changed code) so you can drop the last $TPLG bit. As a bonus it will fix one more shellcheck warning (please run shellcheck -x locally)

Comment thread test-case/check-signal-stop-start.sh Resolved
Fixed shellcheck error, no function changed.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
When aplay or arecord process is terminated during the test,
while loop condition catches the error first then just return
the function. In this case it ends up with a false pass.

Removed the process check from while loop. sof-process-state.sh will do it
anyway.

issue link: thesofproject#988
Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
@fredoh9
fredoh9 force-pushed the fix/stop-start-io-error branch from 9611572 to 153ee2b Compare February 1, 2023 21:10
@fredoh9

fredoh9 commented Feb 1, 2023

Copy link
Copy Markdown
Contributor Author

Good catch BTW: so this test has provided the "ultimate green failure" for many years?

Yes, sadly this has given us false positive for years.

@fredoh9
fredoh9 requested a review from marc-hb February 1, 2023 21:11
# shellcheck source=case-lib/lib.sh
source "$(dirname "${BASH_SOURCE[0]}")"/../case-lib/lib.sh

OPT_NAME['t']='tplg' OPT_DESC['t']='tplg file, default value is env TPLG'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this no longer shows the value of $TPLG?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this no longer shows the value of $TPLG?

It does; I just "unresolved" the comment above that explains this. Try -h.

dlogi "Testing: run stop/start test on PCM:$pcm,$pipeline_type. Interval time: $interval"
dlogc "$cmd -D$dev -r $rate -c $channel -f $fmt $dummy_file -q &"
$cmd -D$dev -r $rate -c $channel -f $fmt $dummy_file -q &
$cmd -D"$dev" -r "$rate" -c "$channel" -f "$fmt" $dummy_file -q &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shellcheck didn't care about $dummy_file?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shellcheck seems smart enough to find "local" variables and make sure they don't include any problematic character.

@fredoh9

fredoh9 commented Feb 2, 2023

Copy link
Copy Markdown
Contributor Author

I'd like to merge this before the daily build/test today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

False Pass / green failure P1 Blocker bugs or important features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants