Skip to content

Commit

Permalink
Change timeouts & retry durations
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Oct 17, 2022
1 parent ab117c3 commit 0b7d3d9
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions x-pack/test/functional/services/ml/data_visualizer_index_based.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,22 @@ export function MachineLearningDataVisualizerIndexBasedProvider({
| 'dvRandomSamplerOptionOff',
expectedProbability?: number
) {
await retry.tryForTime(2000, async () => {
await retry.tryForTime(20000, async () => {
await browser.pressKeys(browser.keys.ESCAPE);
await testSubjects.clickWhenNotDisabled('dvRandomSamplerOptionsButton');
await testSubjects.existOrFail('dvRandomSamplerOptionsPopover');

if (expectedOption === 'dvRandomSamplerOptionOff') {
await testSubjects.existOrFail('dvRandomSamplerOptionOff');
await testSubjects.missingOrFail('dvRandomSamplerProbabilityRange');
await testSubjects.missingOrFail('dvRandomSamplerAutomaticProbabilityMsg');
await testSubjects.existOrFail('dvRandomSamplerOptionOff', { timeout: 1000 });
await testSubjects.missingOrFail('dvRandomSamplerProbabilityRange', { timeout: 1000 });
await testSubjects.missingOrFail('dvRandomSamplerAutomaticProbabilityMsg', {
timeout: 1000,
});
}

if (expectedOption === 'dvRandomSamplerOptionOnManual') {
await testSubjects.existOrFail('dvRandomSamplerOptionOnManual');
await testSubjects.existOrFail('dvRandomSamplerProbabilityRange');
await testSubjects.existOrFail('dvRandomSamplerOptionOnManual', { timeout: 1000 });
await testSubjects.existOrFail('dvRandomSamplerProbabilityRange', { timeout: 1000 });
if (expectedProbability !== undefined) {
const probability = await testSubjects.getAttribute(
'dvRandomSamplerProbabilityRange',
Expand All @@ -271,8 +273,10 @@ export function MachineLearningDataVisualizerIndexBasedProvider({
}

if (expectedOption === 'dvRandomSamplerOptionOnAutomatic') {
await testSubjects.existOrFail('dvRandomSamplerOptionOnAutomatic');
await testSubjects.existOrFail('dvRandomSamplerAutomaticProbabilityMsg');
await testSubjects.existOrFail('dvRandomSamplerOptionOnAutomatic', { timeout: 1000 });
await testSubjects.existOrFail('dvRandomSamplerAutomaticProbabilityMsg', {
timeout: 1000,
});

if (expectedProbability !== undefined) {
const probabilityText = await testSubjects.getVisibleText(
Expand All @@ -293,18 +297,18 @@ export function MachineLearningDataVisualizerIndexBasedProvider({
| 'dvRandomSamplerOptionOnManual'
| 'dvRandomSamplerOptionOff'
) {
await retry.tryForTime(2000, async () => {
await retry.tryForTime(20000, async () => {
// escape popover
await browser.pressKeys(browser.keys.ESCAPE);
await this.assertRandomSamplingOptionsButtonExists();
await testSubjects.clickWhenNotDisabled('dvRandomSamplerOptionsButton');
await testSubjects.existOrFail('dvRandomSamplerOptionsPopover');
await testSubjects.existOrFail('dvRandomSamplerOptionsPopover', { timeout: 1000 });

await testSubjects.clickWhenNotDisabled('dvRandomSamplerOptionsSelect');

await testSubjects.existOrFail('dvRandomSamplerOptionOff');
await testSubjects.existOrFail('dvRandomSamplerOptionOnManual');
await testSubjects.existOrFail('dvRandomSamplerOptionOnAutomatic');
await testSubjects.existOrFail('dvRandomSamplerOptionOff', { timeout: 1000 });
await testSubjects.existOrFail('dvRandomSamplerOptionOnManual', { timeout: 1000 });
await testSubjects.existOrFail('dvRandomSamplerOptionOnAutomatic', { timeout: 1000 });

await testSubjects.click(option);

Expand Down

0 comments on commit 0b7d3d9

Please sign in to comment.