diff --git a/x-pack/legacy/plugins/code/server/lib/esqueue/worker.js b/x-pack/legacy/plugins/code/server/lib/esqueue/worker.js index e8d63b2906acc..3713027b36c69 100644 --- a/x-pack/legacy/plugins/code/server/lib/esqueue/worker.js +++ b/x-pack/legacy/plugins/code/server/lib/esqueue/worker.js @@ -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' ] }, diff --git a/x-pack/test/api_integration/apis/code/repo_status.ts b/x-pack/test/api_integration/apis/code/repo_status.ts index e0d1eace792a7..3af1595ecc1a4 100644 --- a/x-pack/test/api_integration/apis/code/repo_status.ts +++ b/x-pack/test/api_integration/apis/code/repo_status.ts @@ -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}`) diff --git a/x-pack/test/functional/apps/code/explore_repository.ts b/x-pack/test/functional/apps/code/explore_repository.ts index 5cb06b2229cb4..d979fec16663e 100644 --- a/x-pack/test/functional/apps/code/explore_repository.ts +++ b/x-pack/test/functional/apps/code/explore_repository.ts @@ -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'; diff --git a/x-pack/test/functional/apps/code/manage_repositories.ts b/x-pack/test/functional/apps/code/manage_repositories.ts index d2cf5b8eec393..4fc28d6a3130e 100644 --- a/x-pack/test/functional/apps/code/manage_repositories.ts +++ b/x-pack/test/functional/apps/code/manage_repositories.ts @@ -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', () => { diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index 6bd3072fdd8c3..63ad7ff259dea 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -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'),