Skip to content

[lldb/test] Add events listener helper function to lldbtest] #4109

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

Merged
merged 3 commits into from
Mar 24, 2022

Conversation

medismailben
Copy link

This patch introduces 2 new lldb utility functions:

  • lldbutil.start_listening_from: This can be called in the test setup to
    create a listener and set it up for a specific event mask and add it
    to the user-provided broadcaster's list.
  • lldbutil.fetch_next_event: This will use fetch a single event from the
    provided istener and return it if it matches the provided broadcaster.

The motivation behind this is to easily test new kinds of events
(i.e. Swift type-system progress events). However, this patch also
updates TestProgressReporting.py and TestDiagnosticReporting.py
to make use of these new helper functions.

Differential Revision: https://reviews.llvm.org/D122193

Signed-off-by: Med Ismail Bennani [email protected]

labath and others added 2 commits March 23, 2022 12:39
It removes the "wait-until-event-thread-stops" logic, which makes
TestDiagnosticReporting.py flaky.

This reverts commits 09ff41a and
acdd41b.

(cherry picked from commit 8bf8934)
This patch introduces 2 new lldb utility functions:
- lldbutil.start_listening_from: This can be called in the test setup to
  create a listener and set it up for a specific event mask and add it
  to the user-provided broadcaster's list.
- lldbutil.fetch_next_event: This will use fetch a single event from the
  provided istener and return it if it matches the provided broadcaster.

The motivation behind this is to easily test new kinds of events
(i.e. Swift type-system progress events). However, this patch also
updates `TestProgressReporting.py` and `TestDiagnosticReporting.py`
to make use of these new helper functions.

Differential Revision: https://reviews.llvm.org/D122193

Signed-off-by: Med Ismail Bennani <[email protected]>
…per functions

This patch updates TestSwiftProgressReporting.py to use the new event listener
helper function `start_listening_from` and `fetch_next_event`.

It keeps fetching new events until it have matched all the expected
swift type-system progress events message.

If the we're missing one of the expected event, the test will error out,
because of `fetch_next_event` won't be getting any new event.

Signed-off-by: Med Ismail Bennani <[email protected]>
@medismailben
Copy link
Author

@swift-ci test

@medismailben medismailben merged commit 332fbd7 into swiftlang:stable/20211026 Mar 24, 2022
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.

2 participants