It's not looping, that's the problem
nearly there, just the loop now needs to actually finish when waiting or indexing to complete
Now it doesn't work because it's not thread safe which is fine because I knew that and I can fix that problem quite easily by writing proper code
Removed testbd