import com.google.common.base.Optional;
import com.google.common.util.concurrent.ListenableFuture;
-
+import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
distributedDataStore.onGlobalContextUpdated(TestModel.createTestContext());
- // This sleep is fragile - test can fail intermittently if all Shards aren't updated with
- // the SchemaContext in time. Is there any way we can make this deterministic?
- Thread.sleep(2000);
+ Thread.sleep(1500);
DOMStoreReadWriteTransaction transaction =
distributedDataStore.newReadWriteTransaction();
Optional<NormalizedNode<?, ?>> optional = future.get();
+ Assert.assertTrue(optional.isPresent());
+
NormalizedNode<?, ?> normalizedNode = optional.get();
assertEquals(TestModel.TEST_QNAME, normalizedNode.getNodeType());