Skip to content

Commit

Permalink
ensure timezone attribute in tests is adhered to (#13121) (#13126)
Browse files Browse the repository at this point in the history
* ensure timezone attribute is adhered to

Two issues - one the archiver was loading the visualize mapping after
the config setting so it was bring overwritten, and two,
uiSettings.replace wasn’t working correctly to begin with.

* extra line to ensure server is stabilized to prevent transitory failures
  • Loading branch information
stacey-gammon authored Jul 26, 2017
1 parent f6e3aa1 commit 43b66ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/common/services/kibana_server/ui_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class KibanaServerUiSettings {

async replace(doc) {
this._log.debug('replacing kibana config doc: %j', doc);
await this._savedObjectsClient.create('config', { doc }, {
await this._savedObjectsClient.create('config', doc, {
id: await this._id(),
overwrite: true,
});
Expand Down
20 changes: 6 additions & 14 deletions test/functional/apps/visualize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,13 @@ export default function ({ getService, loadTestFile }) {
const kibanaServer = getService('kibanaServer');

describe('visualize app', function () {
before(function () {
remote.setWindowSize(1280,800);

before(async function () {
log.debug('Starting visualize before method');
const logstash = esArchiver.loadIfNeeded('logstash_functional');
// delete .kibana index and update configDoc
return kibanaServer.uiSettings.replace({ 'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*' })
.then(function loadkibanaIndexPattern() {
log.debug('load kibana index with default index pattern');
return esArchiver.load('visualize');
})
// wait for the logstash data load to finish if it hasn't already
.then(function () {
return logstash;
});
remote.setWindowSize(1280, 800);
await esArchiver.loadIfNeeded('logstash_functional');
await esArchiver.load('visualize');
await kibanaServer.waitForStabilization();
await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC', 'defaultIndex': 'logstash-*' });
});

loadTestFile(require.resolve('./_chart_types'));
Expand Down

0 comments on commit 43b66ce

Please sign in to comment.