Commit f03e371
[OPIK-5219] [BE] Fix pass_rate query reading from wrong table (always returns 100%) - hotfix (#5805)
* [OPIK-5219] [BE] Fix pass_rate query to read from assertion_results instead of feedback_scores
The GET_PASS_RATE_AGGREGATION query in ExperimentAggregatesDAO was reading
from feedback_scores to determine run pass/fail, but assertion scores with
category_name="suite_assertion" are routed exclusively to the assertion_results
table by FeedbackScoreService. This caused every run to have no scores in
feedback_scores, defaulting to "passed" and producing 100% pass rate.
Replaced feedback_scores_combined/feedback_scores_final CTEs with
assertion_results_final using the same ROW_NUMBER() deduplication pattern
as ExperimentDAO.java.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* [OPIK-5219] [BE] Fix flaky test: use shared workspace for pass rate aggregation test
The test was creating a new workspace per run, but populateAggregations
silently returned empty when getExperimentData couldn't find the
experiment in the freshly-created workspace (ClickHouse timing).
Use the static shared workspace and createExperimentItemWithData helper
matching all other passing tests in this class.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent a6a99b5 commit f03e371
File tree
2 files changed
+121
-25
lines changed- apps/opik-backend/src
- main/java/com/comet/opik/domain/experiments/aggregations
- test/java/com/comet/opik/domain
2 files changed
+121
-25
lines changedLines changed: 21 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
| 449 | + | |
459 | 450 | | |
460 | 451 | | |
461 | 452 | | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
474 | 470 | | |
475 | 471 | | |
476 | 472 | | |
| |||
479 | 475 | | |
480 | 476 | | |
481 | 477 | | |
482 | | - | |
| 478 | + | |
483 | 479 | | |
484 | | - | |
| 480 | + | |
485 | 481 | | |
486 | 482 | | |
487 | 483 | | |
488 | | - | |
| 484 | + | |
489 | 485 | | |
490 | 486 | | |
491 | 487 | | |
| |||
Lines changed: 100 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
1689 | 1690 | | |
1690 | 1691 | | |
1691 | 1692 | | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1692 | 1792 | | |
1693 | 1793 | | |
1694 | 1794 | | |
| |||
0 commit comments