diff --git a/docker-compose.yml b/docker-compose.yml index 0566a7b6d..ef8bd7e2a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,25 +35,25 @@ services: # It is essential to have an extra directory `/slowlogs/` between host and container; # Otherwise, MySQL in Docker for Mac completely locks during/after slowlog rotation tests. - mysql: - image: ${MYSQL_IMAGE:-percona:5.7.30} - container_name: pmm-agent_mysql_5_7 - command: > - --sql-mode="ANSI_QUOTES" - --performance-schema --innodb_monitor_enable=all --userstat - --slow_query_log --log_slow_rate_limit=1 --log_slow_admin_statements --log_slow_slave_statements --slow_query_log_file=/tmp/mysql/log/ps5_slow_log.log --long_query_time=0 - --character-set-server=utf8 --default-authentication-plugin=mysql_native_password --collation-server=utf8_unicode_ci - ports: - - "3309:3306" - environment: - - MYSQL_ROOT_PASSWORD=^O6VrIoC1@9b - - MYSQL_USER=pmm-agent - - MYSQL_PASSWORD=pmm%*&agent-password - - UMASK=0777 # for slowlog file - volumes: - - /tmp/mysql/log:/tmp/mysql/log:rw - networks: - - pmm-network +# mysql: +# image: ${MYSQL_IMAGE:-percona:5.7.30} +# container_name: pmm-agent_mysql_5_7 +# command: > +# --sql-mode="ANSI_QUOTES" +# --performance-schema --innodb_monitor_enable=all --userstat +# --slow_query_log --log_slow_rate_limit=1 --log_slow_admin_statements --log_slow_slave_statements --slow_query_log_file=/tmp/mysql/log/ps5_slow_log.log --long_query_time=0 +# --character-set-server=utf8 --default-authentication-plugin=mysql_native_password --collation-server=utf8_unicode_ci +# ports: +# - "3309:3306" +# environment: +# - MYSQL_ROOT_PASSWORD=^O6VrIoC1@9b +# - MYSQL_USER=pmm-agent +# - MYSQL_PASSWORD=pmm%*&agent-password +# - UMASK=0777 # for slowlog file +# volumes: +# - /tmp/mysql/log:/tmp/mysql/log:rw +# networks: +# - pmm-network mysql8: image: ${MYSQL_IMAGE:-percona:8.0} @@ -175,7 +175,7 @@ services: /usr/share/sysbench/tests/include/oltp_legacy/oltp.lua \ prepare sysbench \ - --rate=200 \ + --rate=100 \ --threads=64 \ --report-interval=10 \ --time=0 \ diff --git a/tests/configuration/verifyPMMInventory_test.js b/tests/configuration/verifyPMMInventory_test.js index c96e5814d..38658daf5 100644 --- a/tests/configuration/verifyPMMInventory_test.js +++ b/tests/configuration/verifyPMMInventory_test.js @@ -347,8 +347,7 @@ Scenario( remoteInstancesPage.openAddRemotePage('external'); const inputs = await remoteInstancesPage.fillRemoteFields(externalExporterServiceName); - I.waitForVisible(remoteInstancesPage.fields.addService, 30); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); const newLabels = { environment: `${inputs.environment} edited` || `${externalExporterServiceName} environment edited`, @@ -411,8 +410,7 @@ Scenario( remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port, ); I.scrollPageToBottom(); - I.waitForVisible(remoteInstancesPage.fields.addService, 30); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); const newLabels = { environment: `${remoteInstancesHelper.remote_instance.haproxy.environment} edited` || `${haproxyServiceName} environment edited`, @@ -476,7 +474,7 @@ Data(azureServices).Scenario( remoteInstancesPage.verifyAddInstancePageOpened(); const inputs = await remoteInstancesPage.fillRemoteRDSFields(serviceName); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); const newLabels = { environment: `${inputs.environment} edited` || `${serviceName} environment edited`, diff --git a/tests/dashboards/verifyGCRemoteInstance_test.js b/tests/dashboards/verifyGCRemoteInstance_test.js index 95bedf4a9..ac7eda8ea 100644 --- a/tests/dashboards/verifyGCRemoteInstance_test.js +++ b/tests/dashboards/verifyGCRemoteInstance_test.js @@ -69,7 +69,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(instanceType); await remoteInstancesPage.addRemoteDetails(instanceDetails); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(instanceDetails.serviceName); await pmmInventoryPage.verifyAgentHasStatusRunning(instanceDetails.serviceName); // Waiting for metrics to start hitting PMM-Server diff --git a/tests/pages/remoteInstancesPage.js b/tests/pages/remoteInstancesPage.js index 256496c69..c9fca29fb 100644 --- a/tests/pages/remoteInstancesPage.js +++ b/tests/pages/remoteInstancesPage.js @@ -503,7 +503,6 @@ module.exports = { createRemoteInstance(serviceName) { I.waitForVisible(this.fields.skipTLSL, 30); - I.waitForVisible(this.fields.addService, 30); I.checkOption(this.fields.skipTLSL); // eslint-disable-next-line default-case switch (serviceName) { @@ -521,12 +520,34 @@ module.exports = { I.click(this.fields.disableBasicMetrics); break; } - I.click(this.fields.addService); + + this.clickAddInstanceAndWaitForSuccess(); I.waitForVisible(pmmInventoryPage.fields.serviceRow(serviceName), 30); return pmmInventoryPage; }, + clickAddInstanceAndWaitForSuccess() { + I.waitForVisible(this.fields.addService, 30); + I.click(this.fields.addService); + + I.waitForResponse( + (response) => { + if (response.url().includes('v1/management/services')) { + if (response.status() === 200) { + return true; + } + + throw new Error(`Expected status 200 but received ${response.status()}`); + } + + // Continue waiting if this isn't the target request + return false; + }, + 30, + ); + }, + openAddAzure() { I.waitForVisible(this.fields.addAzureMySQLPostgreSQL, 10); I.click(this.fields.addAzureMySQLPostgreSQL); diff --git a/tests/qa-integration/pmm_ps_integration_test.js b/tests/qa-integration/pmm_ps_integration_test.js index a8395c077..babe99fba 100644 --- a/tests/qa-integration/pmm_ps_integration_test.js +++ b/tests/qa-integration/pmm_ps_integration_test.js @@ -47,7 +47,7 @@ Scenario( I.fillField(remoteInstancesPage.fields.password, details.password); I.fillField(remoteInstancesPage.fields.environment, details.environment); I.fillField(remoteInstancesPage.fields.cluster, details.cluster); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30); I.wait(10); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( diff --git a/tests/qa-integration/pmm_psmdb_integration_test.js b/tests/qa-integration/pmm_psmdb_integration_test.js index cd9ff59c0..132a65f2b 100644 --- a/tests/qa-integration/pmm_psmdb_integration_test.js +++ b/tests/qa-integration/pmm_psmdb_integration_test.js @@ -48,7 +48,7 @@ Scenario( I.fillField(remoteInstancesPage.fields.environment, details.environment); I.fillField(remoteInstancesPage.fields.cluster, details.cluster); I.click(remoteInstancesPage.fields.useQANMongoDBProfiler); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { diff --git a/tests/qa-integration/pmm_pxc_integration_test.js b/tests/qa-integration/pmm_pxc_integration_test.js index 57b970acb..cd2278c8e 100644 --- a/tests/qa-integration/pmm_pxc_integration_test.js +++ b/tests/qa-integration/pmm_pxc_integration_test.js @@ -47,7 +47,7 @@ Scenario( I.fillField(remoteInstancesPage.fields.password, details.password); I.fillField(remoteInstancesPage.fields.environment, details.environment); I.fillField(remoteInstancesPage.fields.cluster, details.cluster); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // I.waitForVisible(pmmInventoryPage.fields.agentsLink, 30); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { diff --git a/tests/remoteInstances/remoteInstancesHelper.js b/tests/remoteInstances/remoteInstancesHelper.js index 76f400d9c..f5a505892 100644 --- a/tests/remoteInstances/remoteInstancesHelper.js +++ b/tests/remoteInstances/remoteInstancesHelper.js @@ -390,7 +390,7 @@ module.exports = { // Used for Adding Remote Instance during Upgrade Tests runs for AMI and Docker via API instanceTypes: { - mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'MySQL' : undefined), + mysql: (remoteInstanceStatus.mysql.ps_8_0.enabled ? 'MySQL' : undefined), postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'PostgreSQL' : undefined), mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'MongoDB' : undefined), proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'ProxySQL' : undefined), @@ -402,7 +402,7 @@ module.exports = { // Generic object for each service type, used by both UI/Upgrade jobs depending on the service being used - don't add RDS here serviceTypes: { mysql: ( - remoteInstanceStatus.mysql.ps_5_7.enabled ? { + remoteInstanceStatus.mysql.ps_8_0.enabled ? { serviceType: SERVICE_TYPE.MYSQL, service: 'mysql', } : undefined @@ -453,7 +453,7 @@ module.exports = { // General Remote Instances Service List, this is what UI-tests job uses to run remote instances tests. services: { - mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'mysql_remote_new' : undefined), + mysql: (remoteInstanceStatus.mysql.ps_8_0.enabled ? 'mysql_remote_new' : undefined), mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'mongodb_remote_new' : undefined), postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgresql_remote_new' : undefined), proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_remote_new' : undefined), @@ -465,7 +465,7 @@ module.exports = { // Only add a service here when you want to include it as part of Upgrade tests cycle for AMI and Docker upgradeServiceNames: { - mysql: (remoteInstanceStatus.mysql.ps_5_7.enabled ? 'mysql_upgrade_service' : undefined), + mysql: (remoteInstanceStatus.mysql.ps_8_0.enabled ? 'mysql_upgrade_service' : undefined), mongodb: (remoteInstanceStatus.mongodb.psmdb_4_2.enabled ? 'psmdb_upgrade_scervice' : undefined), proxysql: (remoteInstanceStatus.proxysql.proxysql_2_1_1.enabled ? 'proxysql_upgrade_service' : undefined), postgresql: (remoteInstanceStatus.postgresql.pdpgsql_13_3.enabled ? 'postgres_upgrade_service' : undefined), diff --git a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js index 8cf4286a8..e89c11d4d 100644 --- a/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js +++ b/tests/verifyAzureMySQLPostgreSQLRemoteInstance_test.js @@ -43,7 +43,7 @@ Data(azureServices).Scenario( remoteInstancesPage.startMonitoringOfInstance(current.instanceToMonitor); remoteInstancesPage.verifyAddInstancePageOpened(); await remoteInstancesPage.fillRemoteRDSFields(serviceName); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(serviceName); if (serviceName === 'azure-MySQL') { diff --git a/tests/verifyRemoteInstances_test.js b/tests/verifyRemoteInstances_test.js index 5414a44b0..55a17fba7 100644 --- a/tests/verifyRemoteInstances_test.js +++ b/tests/verifyRemoteInstances_test.js @@ -75,8 +75,7 @@ Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage('external'); await remoteInstancesPage.fillRemoteFields(externalExporterServiceName); - I.waitForVisible(remoteInstancesPage.fields.addService, 30); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(externalExporterServiceName); await I.click(pmmInventoryPage.fields.showServiceDetails(externalExporterServiceName)); await I.click(pmmInventoryPage.fields.agentsLinkNew); @@ -206,8 +205,7 @@ Scenario( remoteInstancesHelper.remote_instance.haproxy.haproxy_2.port, ); I.scrollPageToBottom(); - I.waitForVisible(remoteInstancesPage.fields.addService, 30); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(haproxyServiceName); await I.click(pmmInventoryPage.fields.showServiceDetails(haproxyServiceName)); @@ -260,10 +258,10 @@ Data(remotePostgreSQL).Scenario( I.waitForVisible(remoteInstancesPage.fields.skipTLSL, 30); I.click(remoteInstancesPage.fields.skipTLSL); I.click(current.trackingOption); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(current.instanceName); await pmmInventoryPage.verifyAgentHasStatusRunning(current.instanceName); - pmmInventoryPage.checkExistingAgent(current.checkAgent); + await pmmInventoryPage.checkExistingAgent(current.checkAgent); }, ); @@ -336,7 +334,7 @@ Scenario( I.click(remoteInstancesPage.fields.addService); I.verifyPopUpMessage(errorMessage); I.fillField(remoteInstancesPage.fields.database, 'not_default_db'); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName); await pmmInventoryPage.verifyAgentHasStatusRunning(remoteServiceName); // verify metric for client container node instance diff --git a/tests/verifyTLSMongoDBRemoteInstance_test.js b/tests/verifyTLSMongoDBRemoteInstance_test.js index 03976c62a..4da69c98f 100644 --- a/tests/verifyTLSMongoDBRemoteInstance_test.js +++ b/tests/verifyTLSMongoDBRemoteInstance_test.js @@ -53,7 +53,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { serviceType: SERVICE_TYPE.MONGODB, @@ -221,7 +221,7 @@ Data(instances).Scenario( remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Check Remote Instance also added and have running status pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName); diff --git a/tests/verifyTLSMySQLRemoteInstance_test.js b/tests/verifyTLSMySQLRemoteInstance_test.js index 1c732269c..768c5c464 100644 --- a/tests/verifyTLSMySQLRemoteInstance_test.js +++ b/tests/verifyTLSMySQLRemoteInstance_test.js @@ -69,7 +69,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Add wait for service status to be updated I.wait(10); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( @@ -244,7 +244,7 @@ Data(maxQueryLengthInstances).Scenario( remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Check Remote Instance also added and have running status pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName); diff --git a/tests/verifyTLSPostgresRemoteInstance_test.js b/tests/verifyTLSPostgresRemoteInstance_test.js index 7aa7a68fb..21e95b706 100644 --- a/tests/verifyTLSPostgresRemoteInstance_test.js +++ b/tests/verifyTLSPostgresRemoteInstance_test.js @@ -48,7 +48,7 @@ Data(instances).Scenario( remoteInstancesPage.waitUntilRemoteInstancesPageLoaded(); remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); await inventoryAPI.verifyServiceExistsAndHasRunningStatus( { serviceType: SERVICE_TYPE.POSTGRESQL, @@ -225,7 +225,7 @@ Data(instances).Scenario( remoteInstancesPage.openAddRemotePage(serviceType); await remoteInstancesPage.addRemoteSSLDetails(details); I.fillField(remoteInstancesPage.fields.maxQueryLength, maxQueryLength); - I.click(remoteInstancesPage.fields.addService); + remoteInstancesPage.clickAddInstanceAndWaitForSuccess(); // Check Remote Instance also added and have running status pmmInventoryPage.verifyRemoteServiceIsDisplayed(remoteServiceName);