Skip to content
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

Add debug code to flaky field_data test #15535

Merged
merged 2 commits into from Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -30,7 +30,7 @@ <h3 class="euiTitle euiTitle--small">
</h3>
<div class="euiCodeBlock euiCodeBlock--light euiCodeBlock--fontSmall euiCodeBlock--paddingSmall">
<code class="euiCodeBlock__code">
<pre class="euiCodeBlock__pre">{{req.resp | json}}</pre>
<pre class="euiCodeBlock__pre" data-test-subj="visualizationEsResponseBody">{{req.resp | json}}</pre>
</code>
</div>
</div>
Expand Down
21 changes: 17 additions & 4 deletions test/functional/apps/discover/_field_data.js
Expand Up @@ -4,7 +4,8 @@ export default function ({ getService, getPageObjects }) {
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'header', 'discover']);
const log = getService('log');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize']);

describe('discover app', function describeIndexTests() {
before(async function () {
Expand Down Expand Up @@ -68,7 +69,7 @@ export default function ({ getService, getPageObjects }) {
});
});

it.skip('doc view should show oldest time first', function () {
it('doc view should show oldest time first', function () {
// Note: Could just check the timestamp, but might as well check that the whole doc is as expected.
const ExpectedDoc =
'September 22nd 2015, 23:50:13.253\ntype:apache index:logstash-2015.09.22 @timestamp:September 22nd 2015, 23:50:13.253'
Expand Down Expand Up @@ -114,8 +115,20 @@ export default function ({ getService, getPageObjects }) {
+ ' 2014, 16:00:51.000, November 27th 2014, 16:28:42.000 relatedContent.article:published_time:July 26th'
+ ' 2007, 19:42:30.000, December 13th 2007, 20:19:35.000';
return PageObjects.discover.getDocTableIndex(1)
.then(function (rowData) {
expect(rowData).to.be(ExpectedDoc);
.then(async function (rowData) {
try {
expect(rowData).to.be(ExpectedDoc);
}
catch (e) {
const esResponse = JSON.parse(await PageObjects.visualize.getVisualizationResponse());
const rawActualDoc = esResponse.hits.hits.find(function (hit) {
return hit._id === 'AU_x3_g4GFA8no6QjkYX' && hit._index === 'logstash-2015.09.22';
});
log.info('Attemping to get more debug info on this flaky test. Ping @bargs if you see this fail');
log.info(JSON.stringify(rawActualDoc));
await PageObjects.visualize.closeSpyPanel();
throw e;
}
});
});

Expand Down
7 changes: 7 additions & 0 deletions test/functional/page_objects/visualize_page.js
Expand Up @@ -795,6 +795,13 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
return await testSubjects.getVisibleText('visualizationEsRequestBody');
}

async getVisualizationResponse() {
log.debug('getVisualizationResponse');
await this.openSpyPanel();
await testSubjects.click('spyModeSelect-response');
return await testSubjects.getVisibleText('visualizationEsResponseBody');
}

async getMapBounds() {
const request = await this.getVisualizationRequest();
const requestObject = JSON.parse(request);
Expand Down