fix(ofrep): stop leaking the testbed when it never becomes ready · open-feature/python-sdk-contrib@2ebdebc · GitHub
Skip to content

Commit 2ebdebc

Browse files
committed
fix(ofrep): stop leaking the testbed when it never becomes ready
Two leaks on the same path, both reported by coderabbit on #414. running_testbed called start() outside the try, and start() brings the compose stack up before waiting for readiness. So a readiness timeout left containers running that nothing would stop -- and a suite that cannot reach its backend is exactly when someone runs it again, against the stack the last run abandoned. stop() also never removed the temporary directory that __init__ creates for the bind mount, so every constructed testbed left one behind whether or not anything failed. It now comes off in a finally, because a compose failure is precisely when it would otherwise be missed. Verified on the failing path rather than by inspection: with readiness forced to raise, the temporary directory is removed and no containers remain. The suite is unchanged at 23 passed, 5 skipped, 1 xfailed. Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>
1 parent e21a3ec commit 2ebdebc

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

  • providers/openfeature-provider-ofrep/tests/tck

‎providers/openfeature-provider-ofrep/tests/tck/testbed.py‎

Lines changed: 19 additions & 3 deletions

0 commit comments

Comments
 (0)