8000 relax test condition for windows by dothebart · Pull Request #9393 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

relax test condition for windows #9393

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 6 commits into from
Jul 4, 2019
Merged
Changes from all commits
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
15 changes: 10 additions & 5 deletions tests/js/common/shell/shell-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var jsunity = require("jsunity");
var internal = require("internal");
var errors = internal.errors;
var testHelper = require("@arangodb/test-helper").Helper;
const platform = require('internal').platform;

////////////////////////////////////////////////////////////////////////////////
/// @brief test suite: basics
Expand Down Expand Up @@ -1196,8 +1197,12 @@ function parallelIndexSuite() {
},

testCreateInParallel: function () {
let n = 80;
for (let i = 0; i < n; ++i) {
let noIndices = 80;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a TODO in the code to fix this and open an internal ticket?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, noIndices actually doesn't mean no indexes, but it means number of indexes... So the variable name is at least confusing. When trying to find a prefix for "number" I suggest to use nr, num or just number instead of no in the future. It can stay like this in this PR.

if (platform.substr(0, 3) === 'win') {
// Relax condition for windows - TODO: fix this.
noIndices = 40;
}
for (let i = 0; i < noIndices; ++i) {
let command = 'require("internal").db._collection("' + cn + '").ensureIndex({ type: "hash", fields: ["value' + i + '"] });';
tasks.register({ name: "UnitTestsIndexCreate" + i, command: command });
}
Expand All @@ -1206,19 +1211,19 @@ function parallelIndexSuite() {
let start = time();
while (true) {
let indexes = require("internal").db._collection(cn).getIndexes();
if (indexes.length === n + 1) {
if (indexes.length === noIndices + 1) {
// primary index + user-defined indexes
break;
}
if (time() - start > 180) {
// wait for 3 minutes maximum
fail("Timeout creating 80 indices after 3 minutes: " + JSON.stringify(indexes));
fail("Timeout creating " + noIndices + " indices after 3 minutes: " + JSON.stringify(indexes));
}
require("internal").wait(0.5, false);
}

let indexes = require("internal").db._collection(cn).getIndexes();
assertEqual(n + 1, indexes.length);
assertEqual(noIndices + 1, indexes.length);
},

testCreateInParallelDuplicate: function () {
Expand Down
0