Conversation
76e6509 to
d5e6392
Compare
d5e6392 to
8cb16a3
Compare
| self.requeue_offset = 42 | ||
|
|
||
| class Worker < Base | ||
| class ErrorReport |
There was a problem hiding this comment.
TODO: Find new location for ErrorReport and FailureFormatter. This may break public API?
|
@byroot any opinion on this? RspecQueue makes this quite a difficult refactor... The other option is to move acknowledge down into the reporter and call it as part of |
I haven't spent too much time looking at the implemementation, but yes, the error has to be recorded in the same transaction as the test is acknowledged for it to be fully safe, which is what I do in megatest: https://github.com/byroot/megatest/blob/16fcf099b78fd9d9f8b0b5e5132beff30f5285f2/lib/megatest/redis_queue.rb#L300-L320 (should be a multi instead of a pipeline though). But the challenge as you noticed is to get all that data at once, which is challenging when there isn't an extension API designed to give you that. For the rspec part, IIRC it was marked as deprecated ages ago, you could just remove it if it's really in the way. |
I believe there is a race condition between
acknowledgeandrecord.When we call
acknowledgeit will immediately remove the test from the running set. We only record failure in the next step inrecord. However, we check the running set inexhausted?in the summary to decide when the queue is empty. There is a possibility of removing a test from the running set and the summary exiting before we've actually recorded the failure.acknowledgeandrecordshould be a single operation to avoid this.ci-queue/ruby/lib/minitest/queue.rb
Lines 254 to 255 in dd85b49
ci-queue/ruby/lib/ci/queue/redis/base.rb
Lines 104 to 106 in dd85b49
ci-queue/ruby/lib/ci/queue/redis/base.rb
Lines 121 to 126 in dd85b49
ci-queue/ruby/lib/ci/queue/redis/supervisor.rb
Line 29 in dd85b49
ci-queue/redis/acknowledge.lua
Lines 7 to 8 in dd85b49