Skip to content

Tests: fix for the infamous `bchn-rpc-gbtl-bg-cleaner` sometimes failing

Summary

This fixes issue #148 (closed).

I believe this test randomly fails due to the racey nature of what is happening. As we create block templates, and in particular on slow platforms such as aarch64 in GitLab CI (which may be running emulated or on an RPi), the problem manifests itself.

The fix was to keep scanning the gbt_dir and trash_dir as we iterate for files that we expect to appear -- to catch them early before they have a chance to be deleted.

This allows the test to succeed while not compromising the test's goal: to test that files successfully went from:

gbt_dir -> trash_dir -> deleted.

Test Plan

  • ninja check check-functional
  • On Gitlab CI -- repeatedly re-run the aarch64 functional test job and see if it still failes.
  • Also apply this commit to the "known failing" MRs that we saw and see if it helps fix the failures. The frequency of failures should go down drastically, and perhaps failures are no longer possible entirely with this fix.

Merge request reports