Skip to content

Conversation

@jsarha
Copy link
Contributor

@jsarha jsarha commented Sep 15, 2025

After comp_check_eos() checks were added mux_copy and demux_copy started crashing. Add dummy pipeline with expect_eos = false to bypass the tests.

Fixes: d472d22 ("component: Add eos support in components copy function")

After comp_check_eos() checks were added mux_copy and demux_copy
started crashing. Add dummy pipeline with expect_eos = false to bypass
the tests.

Fixes: d472d22 ("component: Add eos support in components copy function")
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Copilot AI review requested due to automatic review settings September 15, 2025 16:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes test crashes in mux_copy and demux_copy tests that occurred after EOS (End of Stream) checking was added to component copy functions. The fix creates dummy pipeline structures with expect_eos = false to bypass the problematic EOS checks during testing.

  • Adds dummy pipeline initialization in test setup functions
  • Ensures proper cleanup of allocated pipeline structures in teardown functions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/cmocka/src/audio/mux/mux_copy.c Adds dummy pipeline setup and cleanup to fix mux copy test crashes
test/cmocka/src/audio/mux/demux_copy.c Adds dummy pipeline setup and cleanup to fix demux copy test crashes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +190 to +195
/* Add dummy pipeline to bypass comp_check_eos() */
dummy_pipe = test_malloc(sizeof(*dummy_pipe));
if (!dummy_pipe)
return -ENOMEM;
dummy_pipe->expect_eos = false;
dev->pipeline = dummy_pipe;
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The dummy pipeline is only partially initialized. Consider using memset or calloc to zero-initialize the entire structure to avoid potential issues with uninitialized fields.

Copilot uses AI. Check for mistakes.
Comment on lines +168 to +173
/* Add dummy pipeline to bypass comp_check_eos() */
dummy_pipe = test_malloc(sizeof(*dummy_pipe));
if (!dummy_pipe)
return -ENOMEM;
dummy_pipe->expect_eos = false;
dev->pipeline = dummy_pipe;
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The dummy pipeline is only partially initialized. Consider using memset or calloc to zero-initialize the entire structure to avoid potential issues with uninitialized fields.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

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

the failing cmocka test https://github.com/thesofproject/sof/actions/runs/17617615782/job/50054789968 after merging #10143 which this PR fixes

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Thanks @jsarha !

Copy link
Collaborator

@singalsu singalsu left a comment

Choose a reason for hiding this comment

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

It works, thanks!

Copy link
Collaborator

@softwarecki softwarecki left a comment

Choose a reason for hiding this comment

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

ugh. How that PR get through CI test? Sorry for introducing a defect.

@kv2019i kv2019i merged commit b8f3ccb into thesofproject:main Sep 17, 2025
39 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants