itwinjs-core icon indicating copy to clipboard operation
itwinjs-core copied to clipboard

Flaky Test: Checkpoints "after each" fails on subsequent runs

Open MichaelSwigerAtBentley opened this issue 8 months ago • 1 comments

Checkpoints Test 'after each' fails due to a busy container:

  52 passing (3m)
  2 pending
  1 failing

  1) Checkpoints
       "after each" hook for "should be able to open multiple checkpoints in same container when sas expires":
     Error: detach error: container is busy: imodelblocks-b99583da-1de2-43e3-9e6e-a1ad69d1d4a6
      at Function.cleanup (/home/vsts/work/1/s/core/backend/src/CheckpointManager.ts:158:15)
      at Context.<anonymous> (src/integration/Checkpoints.test.ts:112:25)
      at processImmediate (node:internal/timers:485:21)
      at process.callbackTrampoline (node:internal/async_hooks:130:17)

This failure only occurs on subsequent reruns, the after each might not be cleaning up after the tests completely

MichaelSwigerAtBentley avatar Apr 25 '25 21:04 MichaelSwigerAtBentley

I have investigated this, and don't know what is causing the problem. I do have some comments to make, though:

  1. I don't think that it is triggered by multiple attempts on the pipeline ("subsequent reruns"). The reason for this is because the before hook for "Checkpoints" removes the Cloud SQLite cache directory. As far as I can tell, IModelJsFs.removeSync will throw an exception if it fails. Since that didn't happen, I think it's safe to say that the directory is gone before the rest of the "Checkpoint" suite runs.
  2. Because of the above, I believe that something is causing the imodel to still be open at the time of the V2CheckpointManager.cleanup call.
  3. The container in question (imodelblocks-b99583da-1de2-43e3-9e6e-a1ad69d1d4a6) appears to the the Cloud SQLite cloud container for "Stadium Dataset 1".

tcobbs-bentley avatar May 05 '25 23:05 tcobbs-bentley

@MichaelSwigerAtBentley As far as I can tell, this hasn't failed in the last 30 days. Do you think it's ok to close this issue?

tcobbs-bentley avatar Sep 30 '25 17:09 tcobbs-bentley

@MichaelSwigerAtBentley As far as I can tell, this hasn't failed in the last 30 days. Do you think it's ok to close this issue?

Yeah, I think so. We can always reopen the issue if we notice it again.

MichaelSwigerAtBentley avatar Oct 02 '25 16:10 MichaelSwigerAtBentley