[LNT] r305958 - Don't update regressions in this list after commit
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 21 15:01:00 PDT 2017
Author: cmatthews
Date: Wed Jun 21 17:01:00 2017
New Revision: 305958
URL: http://llvm.org/viewvc/llvm-project?rev=305958&view=rev
Log:
Don't update regressions in this list after commit
When we commit below, the SQLAlchemy object become stale, and then when
we scan for state there is a query per regression. Bad. Break
regressions up by state first, so we don't have to requery all this.
Modified:
lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py
Modified: lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py?rev=305958&r1=305957&r2=305958&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py (original)
+++ lnt/trunk/lnt/server/db/rules/rule_update_fixed_regressions.py Wed Jun 21 17:01:00 2017
@@ -38,7 +38,9 @@ def regression_evolution(ts, run_id):
changed = 0
regressions = ts.query(ts.Regression).all()
detects = [r for r in regressions if r.state == RegressionState.DETECTED]
-
+ staged = [r for r in regressions if r.state == RegressionState.STAGED]
+ active = [r for r in regressions if r.state == RegressionState.ACTIVE]
+
for regression in detects:
if is_fixed(ts, regression):
note("Detected fixed regression" + str(regression))
@@ -47,8 +49,6 @@ def regression_evolution(ts, run_id):
changed += 1
ts.commit()
- staged = [r for r in regressions if r.state == RegressionState.STAGED]
-
for regression in staged:
if is_fixed(ts, regression):
note("Staged fixed regression" + str(regression))
@@ -56,9 +56,7 @@ def regression_evolution(ts, run_id):
regression.title = regression.title + " [Detected Fixed]"
changed += 1
ts.commit()
-
- active = [r for r in regressions if r.state == RegressionState.ACTIVE]
-
+
for regression in active:
if is_fixed(ts, regression):
note("Active fixed regression" + str(regression))
More information about the llvm-commits
mailing list