Skip to content

De-flake the minutely probes thread test#1530

Merged
unflxw merged 1 commit into
mainfrom
deflake-minutely-probes-thread-test
Jun 26, 2026
Merged

De-flake the minutely probes thread test#1530
unflxw merged 1 commit into
mainfrom
deflake-minutely-probes-thread-test

Conversation

@unflxw

@unflxw unflxw commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The test asserted "only one probes thread" by counting every live thread in the process, which drifts when unrelated background threads start or stop mid-example. Assert on the probe thread objects directly instead: the previous thread is killed and replaced by exactly one new live thread.

The test asserted "only one probes thread" by counting every live
thread in the process, which drifts when unrelated background threads
start or stop mid-example. Assert on the probe thread objects directly
instead: the previous thread is killed and replaced by exactly one new
live thread.

[skip changeset]
@backlog-helper

backlog-helper Bot commented Jun 26, 2026

Copy link
Copy Markdown

Hi @unflxw,

We've found some issues with your Pull Request.

  • This Pull Request does not include a changeset. Add a changeset if the change impacts users and should be included in the changelog upon release. Read more about changesets.
    Ignore this rule by adding [skip changeset] to your Pull Request body. - (More info)

New issue guide | Backlog management | Rules | Feedback

@unflxw
unflxw requested a review from Copilot June 26, 2026 10:15
@unflxw unflxw added the chore A small task that takes a day or two at the most. label Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 the probes threading spec to avoid flakiness caused by counting all live threads in the Ruby process. Instead, it asserts directly on the Appsignal::Probes internal thread object to verify that restarting probes replaces the previous thread rather than accumulating multiple running probe threads.

Changes:

  • Replace process-wide live-thread counting with direct assertions on the probes thread instance (@thread).
  • Add explicit expectations that a second start replaces the thread and that the old thread terminates.

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

@unflxw
unflxw merged commit ed822c0 into main Jun 26, 2026
208 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A small task that takes a day or two at the most.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants