Skip to content

feat: add scheduling skip reasons to the webUI#7206

Open
okurz wants to merge 1 commit intoos-autoinst:masterfrom
okurz:feature/060_poo198647_why_test_not_executed
Open

feat: add scheduling skip reasons to the webUI#7206
okurz wants to merge 1 commit intoos-autoinst:masterfrom
okurz:feature/060_poo198647_why_test_not_executed

Conversation

@okurz
Copy link
Copy Markdown
Member

@okurz okurz commented Mar 28, 2026

Motivation:
When openQA jobs remain in the scheduled state, users have no way to know why
they are not being assigned. Surfacing scheduler skip reasons reduces
confusion and support requests.

Design Choices:

  • Used the existing "reason" column in the "jobs" table to store per-job
    scheduling skip reasons.
  • Implemented a write-on-change strategy in the scheduler to update the
    reasons only when they change, minimizing database write load.
  • Replaced the direct "df" call in the WebUI with a check on the aggregated
    job reasons to improve efficiency.
  • Added a popover next to the "Scheduled jobs" heading and tooltips on job
    status icons to display the reasons.

Benefits:

  • Provides immediate, per-job feedback to users about scheduling delays.
  • Decouples the WebUI from low-level system checks like disk space.
  • Leverages existing database schema for zero-migration implementation.
Screenshot_20260328_221952_oqa_scheduling_no_issues Screenshot_20260328_235656_oqa_scheduling_however_all_tests Screenshot_20260328_235718_oqa_scheduling_popover Screenshot_20260328_235735_oqa_details_scheduling_info

Related issue: https://progress.opensuse.org/issues/198647

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.87%. Comparing base (6c2911d) to head (dcaae1f).
⚠️ Report is 27 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7206   +/-   ##
=======================================
  Coverage   99.87%   99.87%           
=======================================
  Files         416      416           
  Lines       43597    43630   +33     
=======================================
+ Hits        43542    43575   +33     
  Misses         55       55           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@okurz okurz force-pushed the feature/060_poo198647_why_test_not_executed branch from a8f7862 to 3bb0a90 Compare March 30, 2026 09:40
Copy link
Copy Markdown
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

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

Looks generally good. I only have a few nitpicks and questions.

'</ul>'
: 'No scheduling issues detected';

const popoverIcon = $('#scheduled_jobs_help_icon');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to avoid jQuery in new code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done where? I still see const popoverIcon = $('#scheduled_jobs_help_icon');.

@okurz okurz force-pushed the feature/060_poo198647_why_test_not_executed branch 2 times, most recently from 1329a42 to dcaae1f Compare March 30, 2026 19:11
@d3flex
Copy link
Copy Markdown
Contributor

d3flex commented Mar 31, 2026

image

I think the number of jobs in the popup is redudant. is there a case where the number will not match?

@okurz
Copy link
Copy Markdown
Member Author

okurz commented Mar 31, 2026

I think the number of jobs in the popup is redudant. is there a case where the number will not match?

of course. Jobs can be scheduled and waiting for various things, different worker classes, global job limit, the "df-thingy" you implemented, etc.

@d3flex
Copy link
Copy Markdown
Contributor

d3flex commented Mar 31, 2026

I think the number of jobs in the popup is redudant. is there a case where the number will not match?

of course. Jobs can be scheduled and waiting for various things, different worker classes, global job limit, the "df-thingy" you implemented, etc.

but the amount of scheduled jobs will be always the same. Such, why to add it in the popup?

@kalikiana
Copy link
Copy Markdown
Member

but the amount of scheduled jobs will be always the same. Such, why to add it in the popup?

The total won't be the same if they are delayed for other reasons.

. " (max_running_jobs=$limit, free workers=$free_worker_count, running=$running, allocated=$busy)");
for my $id (keys %$scheduled_jobs) {
next if defined $allocated_jobs->{$id} || $checked_jobs{$id};
$scheduled_jobs->{$id}->{current_reason} //= 'scheduling limit reached';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
$scheduled_jobs->{$id}->{current_reason} //= 'scheduling limit reached';
$scheduled_jobs->{$id}->{current_reason} //= 'scheduling limit reached' . " (max_running_jobs=$limit)";

Can we include the allowed amount here?

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 31, 2026

This pull request is now in conflicts. Could you fix it? 🙏

<div>
<h2 id="scheduled_jobs_heading">Scheduled jobs</h2>
<h2 id="scheduled_jobs_heading" style="display: inline-block">Scheduled jobs</h2><%=
help_popover 'Why is my test not executed?' => 'No scheduling issues detected',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
help_popover 'Why is my test not executed?' => 'No scheduling issues detected',
help_popover 'Why is my test not getting executed?' => 'No scheduling issues detected',

@okurz okurz force-pushed the feature/060_poo198647_why_test_not_executed branch from dcaae1f to aaf25d9 Compare March 31, 2026 21:37
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 1, 2026

This pull request is now in conflicts. Could you fix it? 🙏

Motivation:
When openQA jobs remain in the scheduled state, users have no way to know why
they are not being assigned. Surfacing scheduler skip reasons reduces
confusion and support requests.

Design Choices:
- Used the existing "reason" column in the "jobs" table to store per-job
  scheduling skip reasons.
- Implemented a write-on-change strategy in the scheduler to update the
  reasons only when they change, minimizing database write load.
- Replaced the direct "df" call in the WebUI with a check on the aggregated
  job reasons to improve efficiency.
- Added a popover next to the "Scheduled jobs" heading and tooltips on job
  status icons to display the reasons.
- Refactored the scheduler full test to use dynamic job IDs and early status
  checks for better robustness and readability.
- Introduced a job with an unsatisfiable WORKER_CLASS to verify the
  'no free workers' reason.
- Fixed a bug in the scheduler where the reason for jobs without matching
  workers was overwritten by 'scheduling limit reached'.

Benefits:
- Provides immediate, per-job feedback to users about scheduling delays.
- Decouples the WebUI from low-level system checks like disk space.
- Leverages existing database schema for zero-migration implementation.
- Makes the test suite more resilient to changes in job creation order.
- Fixes an edge case in the scheduler reason reporting.

Related issue: https://progress.opensuse.org/issues/198647
@okurz okurz force-pushed the feature/060_poo198647_why_test_not_executed branch from aaf25d9 to 379e486 Compare April 1, 2026 11:51
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.

4 participants