Skip to content

Use timeout instead of num_sec#123

Merged
mshriver merged 1 commit into
RedHatQE:mainfrom
mshriver:wait-for-timeout
Jun 2, 2026
Merged

Use timeout instead of num_sec#123
mshriver merged 1 commit into
RedHatQE:mainfrom
mshriver:wait-for-timeout

Conversation

@mshriver
Copy link
Copy Markdown
Collaborator

@mshriver mshriver commented Jun 1, 2026

preparation for wait-for v2

failures in the PF6 CI jobs are unrelated to this change and I'd rather not include commits to fix them here.

Summary by Sourcery

Replace deprecated wait_for num_sec parameter with timeout across components and tests.

Enhancements:

  • Update widgetastic Patternfly components to use the timeout argument with wait_for instead of num_sec.

Tests:

  • Update pagination-related tests to use the timeout argument with wait_for instead of num_sec.

Chores:

  • Align navigation and chip components with the new wait_for API in preparation for wait-for v2.

Copilot AI review requested due to automatic review settings June 1, 2026 11:44
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 1, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replace deprecated wait_for argument num_sec with timeout across chip component logic, navigation loading checks, and pagination-related tests to prepare for wait-for v2.

File-Level Changes

Change Details Files
Update chip component wait_for usages to use the new timeout keyword argument.
  • In chip removal, replace num_sec=3 with timeout=3 when waiting for the chip to disappear after clicking the button.
  • In show_more(), call wait_for with timeout=3 instead of num_sec=3 while waiting for the 'show less' button to appear.
  • In show_less(), call wait_for with timeout=3 instead of num_sec=3 while waiting for the 'show more' button to appear.
src/widgetastic_patternfly5/components/chip.py
Update navigation loaded() wait_for usage to the timeout keyword argument.
  • When waiting for the navigation to be marked data-ouia-safe, replace num_sec=10 with timeout=10 in the wait_for call.
src/widgetastic_patternfly5/components/navigation.py
Update pagination tests to use timeout keyword in wait_for calls.
  • In test_pagination, change wait_for(lambda: paginator.is_displayed, num_sec=10) to use timeout=10.
  • In test_pagination_ouia, change wait_for(lambda: paginator.is_displayed, num_sec=10) to use timeout=10.
testing/components/test_pagination.py
testing/ouia/test_pagination_ouia.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/widgetastic_patternfly5/components/chip.py" line_range="107" />
<code_context>
         if not self.read_only:
             self.button.click()
-            wait_for(_gone, num_sec=3, message="wait for chip to dissappear", delay=0.1)
+            wait_for(_gone, timeout=3, message="wait for chip to dissappear", delay=0.1)
         else:
             raise ChipReadOnlyError(self, "Chip is read-only")
</code_context>
<issue_to_address>
**nitpick (typo):** Fix the typo in the wait message string.

Change `"dissappear"` to `"disappear"` in the message so logs remain clean and searchable.

```suggestion
            wait_for(_gone, timeout=3, message="wait for chip to disappear", delay=0.1)
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/widgetastic_patternfly5/components/chip.py Outdated
preparation for wait-for v2

Co-authored-by: Claude <noreply@anthropic.com>
@mshriver mshriver force-pushed the wait-for-timeout branch from 624768b to bb15283 Compare June 1, 2026 11:45
Copy link
Copy Markdown

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 updates widgetastic Patternfly5 components and pagination tests to use the timeout parameter for wait_for, replacing the deprecated num_sec argument in preparation for wait-for v2.

Changes:

  • Replace num_sec with timeout in pagination-related tests.
  • Replace num_sec with timeout in the Navigation component’s readiness wait.
  • Replace num_sec with timeout in Chip component waits.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
testing/ouia/test_pagination_ouia.py Updates wait_for call to use timeout in OUIA pagination fixture setup.
testing/components/test_pagination.py Updates wait_for call to use timeout in pagination fixture setup.
src/widgetastic_patternfly5/components/navigation.py Updates navigation readiness polling to use timeout.
src/widgetastic_patternfly5/components/chip.py Updates chip waits to use timeout (and touches related wait messages).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/widgetastic_patternfly5/components/chip.py
@mshriver mshriver added the enhancement New feature or request label Jun 1, 2026
@mshriver mshriver merged commit 03a8298 into RedHatQE:main Jun 2, 2026
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants