1
0
Fork 0

Explicitly wait for unloaded

This commit is contained in:
Andreas Streichardt 2017-05-24 14:37:30 +02:00
parent ab2dcfb844
commit f08cae2028
1 changed files with 10 additions and 3 deletions

View File

@ -206,8 +206,11 @@ describe('Cluster sync', function() {
db._useDatabase('test');
let collections = db._collections();
expect(collections.map(collection => collection.name())).to.contain('s100001');
expect(db._collection('s100001').status()).to.be.oneOf([ArangoCollection.STATUS_UNLOADED, ArangoCollection.STATUS_UNLOADING]);
let count = 0;
while (db._collection('s100001').status() == ArangoCollection.STATUS_UNLOADING && count++ < 100) {
wait(0.1);
}
expect(db._collection('s100001').status()).to.equal(ArangoCollection.STATUS_UNLOADED);
});
it('should unload an existing collection', function() {
db._create('s100001');
@ -256,7 +259,11 @@ describe('Cluster sync', function() {
};
cluster.executePlanForCollections(plan);
db._useDatabase('test');
expect(db._collection('s100001').status()).to.be.oneOf([ArangoCollection.STATUS_UNLOADED, ArangoCollection.STATUS_UNLOADING]);
let count = 0;
while (db._collection('s100001').status() == ArangoCollection.STATUS_UNLOADING && count++ < 100) {
wait(0.1);
}
expect(db._collection('s100001').status()).to.equal(ArangoCollection.STATUS_UNLOADED);
});
it('should delete a stale collection', function() {
db._create('s100001');