Commit 6d164b5
committed
Sleep 0.5s between
We seem to have a race condition between the component Git repo getting
initialized by `component new` and deleted by `component delete`.
Without the sleep, the test fails at least one in ten times (initial
local numbers are between 9/100 and 24/100 for separate runs). The
failure seems to be caused because something apparently is still
creating files in the bare component checkout while `component delete`
is deleting the bare checkout directory.
We observe a slightly increased number of test failures increases
(locally: approx 1-2 / 100) when we assert that the bare checkout is
fully deleted after `component delete`, in some cases `shutil.rmtree()`
apparently succeeds but the directory remains.
We've landed on 0.5s sleep after trying a couple numbers. We've seen no
failures in ~8000 consecutive test runs with 0.5s sleep. For CI, a
single 0.5s delay in one test (that already takes 1.7-1.8s in isolation
without the sleep) out of >1000 should be acceptable.
Note that we don't actually understand the root cause here, but the
failing test is a synthetic sequence of commands that should almost
never happen in real usage without at least 1s delay between them.
Additionally note that the flakiness disappears when we switch the test
to `subprocess.call()` instead of click's `CliRunner` even without the
sleep( or at least is rare enough that it doesn't show up in >1000
runs).component new and component delete
1 parent 3ca7d7e commit 6d164b5
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
858 | 859 | | |
859 | 860 | | |
860 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
861 | 870 | | |
862 | 871 | | |
863 | 872 | | |
| |||
0 commit comments