[Code] Use seq_no and primary_term to do ES concurrency control for EsQueue and reenable code tests (#41377) (#41398)

* Revert "disable all code tests (#41363)"

This reverts commit 771d70c334.

* Revert "[code] disable failing tests (#41336) (#41338) (#41337)"

This reverts commit 62fedccad5.

* [Code] Use seq_no and primary_term to do ES concurrency control for queue
This commit is contained in:
Mengwei Ding 2019-07-17 14:00:37 -07:00 committed by GitHub
parent 41dbb2b94f
commit 91f581d862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 15 deletions

View file

@ -17,7 +17,6 @@ const puid = new Puid();
function formatJobObject(job) {
return {
index: job._index,
type: job._type,
id: job._id,
// Expose the payload of the job even when the job failed/timeout
...job._source.payload,
@ -125,9 +124,9 @@ export class Worker extends events.EventEmitter {
return this.client.update({
index: job._index,
type: job._type,
id: job._id,
version: job._version,
if_seq_no: job._seq_no,
if_primary_term: job._primary_term,
body: { doc }
})
.then((response) => {
@ -168,9 +167,9 @@ export class Worker extends events.EventEmitter {
return this.client.update({
index: job._index,
type: job._type,
id: job._id,
version: job._version,
if_seq_no: job._seq_no,
if_primary_term: job._primary_term,
body: { doc }
})
.then(() => true)
@ -193,7 +192,6 @@ export class Worker extends events.EventEmitter {
return this.client.update({
index: job._index,
type: job._type,
id: job._id,
version: job._version,
body: { doc }
@ -276,9 +274,9 @@ export class Worker extends events.EventEmitter {
return this.client.update({
index: job._index,
type: job._type,
id: job._id,
version: job._version,
if_seq_no: job._seq_no,
if_primary_term: job._primary_term,
body: { doc }
})
.then(() => {
@ -425,6 +423,7 @@ export class Worker extends events.EventEmitter {
_getPendingJobs() {
const nowTime = moment().toISOString();
const query = {
seq_no_primary_term: true,
_source: {
excludes: [ 'output.content' ]
},

View file

@ -23,8 +23,7 @@ export default function repoStatusTests({ getService }: KibanaFunctionalTestDefa
const TEST_REPO = 'github.com/elastic/TypeScript-Node-Starter';
const TEST_REPO_URL = `https://${TEST_REPO}.git`;
// FAILING: https://github.com/elastic/kibana/issues/41336
describe.skip('repo status', () => {
describe('repo status', () => {
after(async () => {
await supertest
.delete(`${DELETE_API}/${TEST_REPO}`)

View file

@ -23,8 +23,7 @@ export default function exploreRepositoryFunctionalTests({
const FIND_TIME = config.get('timeouts.find');
// FAILING: https://github.com/elastic/kibana/issues/41338
describe.skip('Explore Repository', function() {
describe('Explore Repository', function() {
this.tags('smoke');
describe('Explore a repository', () => {
const repositoryListSelector = 'codeRepositoryList codeRepositoryItem';

View file

@ -18,8 +18,7 @@ export default function manageRepositoriesFunctionalTests({
const log = getService('log');
const PageObjects = getPageObjects(['common', 'header', 'security', 'code', 'home']);
// FAILING: https://github.com/elastic/kibana/issues/41337
describe.skip('Manage Repositories', () => {
describe('Manage Repositories', () => {
const repositoryListSelector = 'codeRepositoryList codeRepositoryItem';
describe('Manage Repositories', () => {

View file

@ -109,7 +109,7 @@ export default async function ({ readConfigFile }) {
resolve(__dirname, './apps/status_page'),
resolve(__dirname, './apps/timelion'),
resolve(__dirname, './apps/upgrade_assistant'),
// resolve(__dirname, './apps/code'),
resolve(__dirname, './apps/code'),
resolve(__dirname, './apps/visualize'),
resolve(__dirname, './apps/uptime'),
resolve(__dirname, './apps/saved_objects_management'),