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

libc: add passing custom parameter to unix-socket test #378

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

adamdebek
Copy link
Contributor

@adamdebek adamdebek commented Oct 7, 2024

…et test

JIRA: CI-501

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Copy link

github-actions bot commented Oct 7, 2024

Unit Test Results

7 787 tests  ±0   7 069 ✅ ±0   40m 55s ⏱️ - 1m 52s
  461 suites ±0     718 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit cca6f20. ± Comparison against base commit 7e3f9f2.

♻️ This comment has been updated with latest results.

@adamdebek adamdebek requested a review from damianloew October 7, 2024 12:48
@nalajcie
Copy link
Member

nalajcie commented Oct 7, 2024

maybe it would be better to pass custom timeout param as a commandline param if possible (that way we will be able to provide custom values for any particular target requiring it?)

@mateusz-bloch
Copy link
Member

image
nit: Commit title should be short, details can be described in the commit message body

Copy link
Member

@nalajcie nalajcie left a comment

Choose a reason for hiding this comment

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

some nitpicks, also 👍 for writing short/simple commit message titles

libc/socket/unix-socket.c Outdated Show resolved Hide resolved
if (argc == 2) {
pollTimeoutDiff = atoi(argv[1]);
}

/* Assume /tmp dir is missing */
Copy link
Member

Choose a reason for hiding this comment

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

is this comment valid? the code looks like we assume initially that it's not missing? Also fix check if (isMissing) to be MISRA-compliant (or use bool)

Copy link
Contributor

Choose a reason for hiding this comment

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

The suggestion hasn't been fully taken into account. Still the comment seems to be wrong. I'd remove the comment and rename the variable name to make readable what is happening in here (createTmpIfMissing doesn't check the arg, it check's whether dir exists anyway and then sets the value).

libc/socket/unix-socket.c Outdated Show resolved Hide resolved
@adamdebek adamdebek force-pushed the adamdebek/CI-501 branch 2 times, most recently from e5f5080 to ddbba9b Compare October 9, 2024 11:49
@adamdebek adamdebek changed the title libc: add custom timeout discrepancy for emulated target in unix-sock… libc: add passing custom parameter to unix-socket test Oct 9, 2024
@adamdebek adamdebek requested a review from nalajcie October 9, 2024 12:12
libc/socket/unix-socket.c Outdated Show resolved Hide resolved
@nalajcie
Copy link
Member

nalajcie commented Oct 9, 2024

image

image

@adamdebek adamdebek force-pushed the adamdebek/CI-501 branch 2 times, most recently from 8790843 to 12e5c5e Compare October 9, 2024 15:19
*/
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--extra-poll-delay-ms") == 0) {
pollTimeoutDelay = atoi(argv[i + 1]);
Copy link
Member

Choose a reason for hiding this comment

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

Should pollTimeoutDelay ever be allowed to have negative value? If not, maybe it'd be good to have a simple argument value validation here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is passed directly in test.yaml, but I can add it.

@adamdebek adamdebek force-pushed the adamdebek/CI-501 branch 2 times, most recently from bae5e5a to 7128227 Compare October 10, 2024 11:01
@adamdebek adamdebek requested a review from nalajcie October 10, 2024 12:11
Copy link
Contributor

@damianloew damianloew left a comment

Choose a reason for hiding this comment

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

Please look at the latest comments and then we can merge it :)

Comment on lines 1496 to 1497
/* Assume /tmp dir is missing */
int isMissing = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/* Assume /tmp dir is missing */
int isMissing = 0;
bool wasTmpMissing = false;

Please see the comment above.

if (argc == 2) {
pollTimeoutDiff = atoi(argv[1]);
}

/* Assume /tmp dir is missing */
Copy link
Contributor

Choose a reason for hiding this comment

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

The suggestion hasn't been fully taken into account. Still the comment seems to be wrong. I'd remove the comment and rename the variable name to make readable what is happening in here (createTmpIfMissing doesn't check the arg, it check's whether dir exists anyway and then sets the value).

Add passing custom parameter to unix-socket test on armv7a9-zynq7000-qemu since
blocking interval significantly overruns timeout due to host system scheduling delays

JIRA: CI-501
@adamdebek adamdebek merged commit 1666b3b into master Oct 29, 2024
36 checks passed
@adamdebek adamdebek deleted the adamdebek/CI-501 branch October 29, 2024 13:18
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.

5 participants