SinghCod3r commented on issue #1232:
URL: https://github.com/apache/couchdb/issues/1232#issuecomment-3246023033

   Hi @janl and @eiri,
   
   Thank you for the discussion on this. I would like to work on this issue.
   
   I've looked into the problem, and the `assertion_failed` error is indeed due 
to a race condition where the test checks for the database size before the 
asynchronous compaction has completed.
   
   My proposed solution follows `eiri`'s suggestion to create a standard test 
wrapper with retry logic.
   
   1.  **Create a `retry_until_success/3` helper function** in a test utility 
module. This function will repeatedly execute a given function, catching any 
assertion errors and retrying after a short delay.
   2.  **Refactor the `wait_compaction/3` function** in 
`couchdb_attachments_tests.erl` to use this new helper. This will make the test 
resilient to normal variations in compaction time.
   
   This approach directly addresses the flakiness. Regarding @janl's point 
about `eunit` timeouts, the retry mechanism will have its own internal timeout 
(e.g., 50 retries with a 100ms delay = 5 seconds max), which should be 
sufficient for the compaction to complete without hitting the global test suite 
timeout.
   
   I will start working on a PR with this implementation. Please assign this 
issue to me.
   
   Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to