8000 Bug fix 3.5/internal issue #651 by gnusi · Pull Request #10388 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix 3.5/internal issue #651 #10388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Nov 12, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tests for replication
  • Loading branch information
gnusi committed Nov 11, 2019
commit 9363e442ed0046adf682e1be44071fdfa6627cb0
45 changes: 45 additions & 0 deletions tests/js/server/replication/sync/replication-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,51 @@ function BaseTestConfig () {
}
},

testSyncViewOnAnalyzersCollection: function () {
connectToMaster();

// create custom analyzer
assertNotEqual(null, db._collection("_analyzers"));
assertEqual(0, db._analyzers.count());
let analyzer = analyzers.save('custom', 'delimiter', { delimiter: ' ' }, ['frequency']);
assertEqual(1, db._analyzers.count());

// create view & collection on master
db._flushCache();
db._createView('analyzersView', 'arangosearch', {
consolidationIntervalMsec:0,
links: { _analyzers: { analyzers: [ analyzer.name() ], includeAllFields:true } }
});

db._flushCache();
connectToSlave();
internal.wait(0.1, false);
// sync on slave
replication.sync({ endpoint: masterEndpoint });

db._flushCache();

assertEqual(1, db._analyzers.count());
var res = db._query("FOR d IN analyzersView OPTIONS {waitForSync:true} RETURN d").toArray();
assertEqual(1, db._analyzers.count());
assertEqual(1, res.length);
assertEqual(db._analyzers.toArray()[0], res[0]);
69BF
{
// check state is the same
let view = db._view('analyzersView');
assertTrue(view !== null);
let props = view.properties();
assertTrue(props.hasOwnProperty('links'));
assertEqual(0, props.consolidationIntervalMsec);
assertEqual(Object.keys(props.links).length, 1);
assertTrue(props.links.hasOwnProperty('_analyzers'));
assertTrue(props.links['_analyzers'].includeAllFields);
assertTrue(props.links['_analyzers'].analyzers.length, 1);
assertTrue(props.links['_analyzers'].analyzers[0], 'custom');
}
},

// //////////////////////////////////////////////////////////////////////////////
// / @brief test with edges
// //////////////////////////////////////////////////////////////////////////////
Expand Down
0