Is there any way you can start two actions in Robotframework. I'm trying to run a process that will run continuously and then make other actions without stopping the first process. The problem is that RF is waiting the first process to finish, then proceed with other actions. well, problem is the first process is not going to stop. Any advice?
Thanks,
Stell
Yes, you can do this with the Process library. It lets you run programs in the background.
In my open source project rfhub, the acceptance test suite has a suite setup that starts the hub in the background.
Here's the keyword that starts the hub:
*** Keywords ***
| Start rfhub
| | [Arguments] | ${PORT}
| | [Documentation]
| | ... | Starts rfhub on the port given in the variable ${PORT}
| | ... | As a side effect this creates a suite variable named ${rfhub process},
| | ... | which is used by the 'Stop rfhub' keyword.
| |
| | ${rfhub process}= | Start process | python | -m | rfhub | --port | ${PORT}
| | Set suite variable | ${rfhub process}
| | Wait until keyword succeeds | 20 seconds | 1 second
| | ... | Verify URL is reachable | /ping
Related
I just installed this plugin to monitor SQL errors:
https://mariadb.com/kb/en/sql-error-log-plugin/
but I can't for the life of me find anything on how to modify the default system variables for that error log plugin, and where.
Anyone?!
You can't modify error plugin log variables via SQL statements. They are either read-only and/or they need to be specified at startup (see source code).
So you have to pass these values either to mariadbd/mysqld or you have to specify these in your configuration file.
Example in /etc/my.cnf:
[server]
sql-error-log-filename=foo.log
sql-error-log-rotate=ON
restart server and check the values
MariaDB [test]> show variables like 'sql_error%';
+--------------------------+---------+
| Variable_name | Value |
+--------------------------+---------+
| sql_error_log_filename | foo.log |
| sql_error_log_rate | 1 |
| sql_error_log_rotate | ON |
| sql_error_log_rotations | 9 |
| sql_error_log_size_limit | 1000000 |
+--------------------------+---------+
Update:
I forgot to set wait_timeout in my.cnf.
I have a persistent connection from my PHP application.
I set the wait_timeout to 600 already.
MariaDB [(none)]> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 600 |
+---------------+-------+
But the connection doesn't be killed automatically when the sleep time over 600 seconds.
Why?
MariaDB [(none)]> show processlist;
+----+------+-----------+------+---------+------+----------+------------------+----------+
| Id | User | Host | db | Command | Time | State | Info | Progress |
+----+------+-----------+------+---------+------+----------+------------------+----------+
| 32 | lin | localhost | NULL | Query | 0 | starting | show processlist | 0.000 |
| 33 | lin | localhost | test | Sleep | 741 | | NULL | 0.000 |
+----+------+-----------+------+---------+------+----------+------------------+----------+
wait_timeout
https://mariadb.com/docs/reference/mdb/system-variables/wait_timeout/
The number of seconds the server waits for activity on a connection before closing it
Any kind of activity or query, will keep the connection open. My guess is that you run other queries during that time.
max_statement_time
This is your per query time
Description: Maximum time in seconds that a query can execute before being aborted. This includes all queries, not just SELECT statements, but excludes statements in stored procedures.
I changed pulling intervals in /etc/ceilometer/pipeline.yaml file from 600 to 60 and can't make the service to use new values. I restarted everything that relates to ceilometer in openstack-status command, but that did not work. Can somebody tell me the proper way how to do it?
I am using Openstack Liberty on Ubuntu 14.04 LTS
root#OS1:~# openstack service list
+----------------------------------+------------+---------------+
| ID | Name | Type |
+----------------------------------+------------+---------------+
| 056fcccaad5c4991a8a0da199ed1d737 | cinderv2 | volumev2 |
| 483a0cd1ba79430690a8960ae3d40222 | glance | image |
| 5c704fc9253e4c15895589eb19fab2ac | keystone | identity |
| 92bfcfb417314e80a43e6e7d4d21f99b | nova | compute |
| a7a3809d73674d3da3fbe8030b47055a | horizon | dashboard |
| c21b5e3c9d68417cb11df60d72f9bb58 | heat | orchestration |
| c7030edb082346328a715b00098b974a | neutron | network |
| d331f5360e2b4d3a854e7f47107a9421 | ec2 | ec2 |
| f0a22f827bed43dbbc43822abfc3e3e0 | ceilometer | metering |
+----------------------------------+------------+---------------+
root#OS11:~# openstack-status
.
.
.
== Ceilometer services ==
ceilometer-api: active
ceilometer-agent-central: active
ceilometer-agent-compute: inactive (disabled on boot)
ceilometer-collector: active
ceilometer-alarm-notifier: active
ceilometer-alarm-evaluator: active
ceilometer-agent-notification:active
.
.
.
Well, you need to restart ceilometer-agent-notification service because this service is responsible for transforming the data into samples in the ceilometer database.
Thus, systemctl restart ceilometer-agent-notification.service will help along with restarting other services.
Since ceilometer-agent-compute service is disabled, you just need to restart ceilometer-agent-central service on the node you have modified the config file.
sudo service ceilometer-agent-central restart
You might want to auto reload pipelines after you modify it, for that, you can set refresh_pipeline_cfg=True and a proper time for pipeline_polling_interval such as 120 seconds in /etc/ceilometer/ceilometer.conf.
Note, be careful when you enable auto reload, and only save pipeline config file after you are sure about the content is right (otherwise it might lose 1 polling period data)
I have written this code in robotframework
${proxy}= | Evaluate | sys.modules['selenium.webdriver'].Proxy() sys, selenium.webdriver |
${proxy.http_proxy}= | Set Variable | 127.0.0.1:8080 |
Create Webdriver | Firefox proxy=${proxy} |
Go To | http://www.knowledgefarm.in/tst/a.html |
And I am running BrowserMob proxy from command line like this:
browsermob-proxy.bat --address 127.0.0.1 --port 8080
Now, when i run robotframework, it open the browser and simple give this message on page.
HTTP ERROR: 404
Problem accessing /tst/a.html. Reason:
Not Found
Powered by Jetty://
Two questions:
why my pages are not loaded. (it works if I remove proxy setting)
After the workaround, how do I specify to generate HAR file and how should I specify the location of HAR file
The above code does not actually start a proxy. To start a proxy, you need to run these commands.
Create | http context | localhost:8080 | http
Post | /proxy
${json} | Get Response Body
${port} | Get Json Value | ${json} | /port
${proxy}= | Evaluate | sys.modules['selenium.webdriver'].Proxy() | sys,selenium.webdriver
${proxy.http_proxy}= | Set Variable | 127.0.0.1:${port}
Create Webdriver | Firefox | proxy=${proxy}
Go To | ${LOGIN URL}
Set Request Body | pageRef=LOGIN&captureContent=false&captureHeaders=true
PUT | /proxy/${port}/har
${json} | HttpLibrary.HTTP.Get Response Body
OperatingSystem.Create File | D:\\myfile.har | ${json}
I am trying to impelment flywaydb in our process. In our env each client has their own instance of the DB.
I have a bash that loops through the clients to run migrate. So the command looks like
flyway -url=jdbc:jtds:sqlserver://localhost:1434/main_client_$ID migrate
This all works when all the clients start from the baseline. But as we add new customers their DB will reflect the newest code. Now we have older clients started with V1(and all the migration scripts to V2) and new clients with the latest DB V2.
I thought i could do something like :::
flyway baseline -url=jdbc:jtds:sqlserver://localhost:1434/main_client_3
--baselineVersion=2 --baselineDescription="Base 2 version"
but when i do it this way then call info i see something like :
+---------+-----------------------+---------------------+---------+
| Version | Description | Installed on | State |
+---------+-----------------------+---------------------+---------+
| 1 | << Flyway Baseline >> | 2015-06-08 22:07:54 | Success |
| 1.1 | update | | Pending |
| 1.2.0 | update | | Pending |
| 1.2.1 | update | | Pending |
+---------+-----------------------+---------------------+---------+
if i look in the DB i see the version value of schema_version set to 1.
if via the DB i force schema_version column value to 1.2.0 i see
+---------+-----------------------+---------------------+---------+
| Version | Description | Installed on | State |
+---------+-----------------------+---------------------+---------+
| 1 | Base version initial | | <Baseln |
| 1.1 | update | | <Baseln |
| 1.2.0 | << Flyway Baseline >> | 2015-06-08 22:07:54 | Success |
| 1.2.1 | update | | Pending |
+---------+-----------------------+---------------------+---------+
This is what i want.
But i can not figure out how to set the value via the baseline command
Thanks for any help
All parameters should be passed in with - not --