We might want to figure out how we support pipeline when we retry jobs. It seems that test results will be cached for them, but not refreshed
maybe we should use updated_at of both pipelines as additional arguments for with_reactive_cache? this increases memory consumption :(
maybe your idea for including updated_at in response and invalidating the cache is the good one. I like your idea better, as it keeps memory consumption.
We might want to figure out how we support pipeline when we retry jobs. It seems that test results will be cached for them, but not refreshed,
I wonder if we can invalidate the cache in ExpirePipelineCacheWorker. The intention of the class is "If pipeline updated, then the cached results should be renewed, too". I feel this concept totally falls into our subject.
diff --git a/app/workers/expire_pipeline_cache_worker.rb b/app/workers/expire_pipeline_cache_worker.rbindex 992fc63c451..774d1507713 100644--- a/app/workers/expire_pipeline_cache_worker.rb+++ b/app/workers/expire_pipeline_cache_worker.rb@@ -22,6 +22,15 @@ class ExpirePipelineCacheWorker end Gitlab::Cache::Ci::ProjectPipelineStatus.update_for_pipeline(pipeline)++ if pipeline.has_test_reports?+ pipeline.all_merge_requests.each do |merge_request|+ merge_request.expire_reactive_cache!(+ :compare_test_results,+ merge_request.base_pipeline&.iid,+ merge_request.actual_head_pipeline.iid)+ end+ end end private
Or, put the eveevent in before_transition any => [:success, :failed, :canceled] do |pipeline| (i.e. when pipeline finished)
@ayufan I also found a bug that Ci::Pipeline#test_reports targets all builds (latest + retried), so I'm going to include the fix as well. This is necessary for invalidating cache properly.
I created https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21039. Let's fix both FE+BE together in the branch (Sorry it's named improve-junit-support-be but we should fix in the same place as the size of changes will be smaller than we had)
I'll also include feature spec into the branch. So all we need to merge in %11.2 is the branch.
I’m not sure about cache invalidation as it should support base and head pipelines together, and if we can do it without cache invalidation it is preferred as we forget about the need to evaluate another edge cases.
The second failure (at end), but we still are able to expand tests seems to be frontend bug.
@filipa it seems that when we show failure on frontend, but next request is succeeded the failure message persist.
We show a failure when the status code is different from 2XX
But it seems that if you constantly pool and show the error, the MR widget will not recover from error state after subsequent run. MR widget will re-poll when it receives test_path: nil and next test_path: something.