Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Expect script tools/apause.exp #1218

Merged
merged 5 commits into from
Jul 15, 2024
Merged

Commits on Jul 10, 2024

  1. multiple-pause-resume.sh: add $TOPDIR variable

    So we can easily find other tools.
    
    Signed-off-by: Marc Herbert <[email protected]>
    marc-hb committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    2d0917e View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. check-pause-resume.sh: add $TOPDIR variable

    So we can invoke other tools easily.
    
    Signed-off-by: Marc Herbert <[email protected]>
    marc-hb committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    33817e9 View commit details
    Browse the repository at this point in the history
  2. Add new Expect script tools/apause.exp

    This all started as an effort to solve test failures caused by "MAX"
    volume. See thesofproject#931 and others linked from there for more context.
    
    Another obvious issue was the duplication of `expect` code across two
    tests (check-pause-resume.sh and multiple-pause-resume.sh)
    
    After a bit of time actually "testing the tests" I realized the original
    author did not really understand `expect` or the problem. So I rewrote
    the entire `expect` part. The list of previous issues is a bit too long
    not to forget any but here are some:
    
    - The script could get "out of sync" with aplay and report that it was
      paused when it was actually resumed! And vice-versa.
    
    - De-duplication; obviously.
    
    - Moving to a separate script also solves the following problems:
      - Can be invoked, tested and debugged separately outside any shell script
      - Simplifies quoting
      - Unlocks editor features like syntax checking
    
    - Proper understanding and handling of newlines.
    
    - The expect script does not "sleep" anymore, which stops backpressuring
      and blocking the console output from aplay - with unknown side effects!
    
    - Adding `log_user 0` makes the test logs readable at last
    
    - Add decent logging for easier maintenance
    
    - Logging timestamps demonstrate that the entire aproach is too slow for
      pause/resume cycles shorter than ~200 ms. Default values won't be
      changed yet but at least the problem is now obvious.
    
    - Handle "MAX" volume! Not an error yet because it happens really across
      the board (MAX does usualy not happen long enough to timeout and
      _fail_ across the board) but the code is ready to upgrade the "MAX"
      warning to an ERROR with a one-line change.
    
    - Report EOF and timeouts differently.
    
    - Probably others.
    
    Signed-off-by: Marc Herbert <[email protected]>
    marc-hb committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    8ba9b23 View commit details
    Browse the repository at this point in the history
  3. multiple-pause-resume.sh: switch to new apause.exp script

    See long commit message in previous commit adding apause.exp
    
    Signed-off-by: Marc Herbert <[email protected]>
    marc-hb committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    5ebbf0c View commit details
    Browse the repository at this point in the history
  4. check-pause-resume.sh: switch to new apause.exp script

    See long commit message in previous commit adding apause.exp
    
    Signed-off-by: Marc Herbert <[email protected]>
    marc-hb committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    cfb796e View commit details
    Browse the repository at this point in the history