Skip to content

obs-websocket: GetStats reports more than 100 % CPU in test_ws_cpu_usage under ASan #3367

Closed

Description

@vpacher

What happens

parallel_get_stats_on_one_session fails now and then in the asan job at test/cmocka/test_ws_cpu_usage.cpp:206:

assert_true(usage <= 100.0);

8 threads call GetStats 50 times each. In some runs one cpuUsage is above 100.

What to do

Find out whether it is a real bug or the test:

  • if cpuUsage is meant to be a share of the whole machine (0–100), a value over 100 is a bug in how GetStats computes it, for example process CPU time over wall time without dividing by the core count, or a short sample interval: fix it;
  • if values over 100 are valid by design, the test is wrong and needs the correct bound.

Then the test is solid, and its entry goes from the sanitizer harness's known list (kind flaky, #3290). Related: #1346.

Activity

  1. added
    bug
    P2
    size:S
    on Nov 1, 2026
  2. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    /ready

  3. added
    ready
    on Nov 1, 2026
  4. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Claiming: GetStats CPU usage over 100 %

    Plan (one PR, after #3290):

    1. Find what cpuUsage is meant to be (share of the machine or of one core) and how a sample goes over 100.
    2. RED/GREEN: fix the computation, or the bound in the test if values over 100 are valid.
    3. Drop its flaky entry from the known list.

    First PR: after #3290 merges.

  5. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Blocked: waiting on #3290

  6. added
    claim-blocked
    on Nov 1, 2026
  7. removed
    claim-blocked
    on Nov 1, 2026
  8. moved this from Blocked to In review in obs-rust Multiviewon Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2bugreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions