I am using dgraph for integration tests using the Go client. Before each test, I alter the database using DropAll. I then recreate the schema using alter.
I find that I need to set a sleep after executing DropAll. I also need a separate sleep after updating the schema. This method works most of the time but has its own flaws. Sometimes, the schema does not update correctly and I get attribute not indexed errors. In addition, the sleeps slow down my tests significantly, as I am using 5 seconds after DropAll and another 5 seconds after updating the schema.
Are DropAll and schema alterations synchronous? If not, is there an option to have them execute in a synchronous manner?