Why is PollingIntervalTest test_getlastupdate_no_change failing with the error “could not convert string to float” in Sonos Self-Test Suite - sonos

I've run the Sonos Self-Test Suite available here and everything passes except for this one error, and I'm not sure why:
Test case: PollingIntervalTest test_getlastupdate_no_change
Instance messages: could not convert string to float
...more output...
2016-02-23 09:43:40,834 [STOP] SONOS.sonos.workflow.fixture.PollingIntervalTest - could not convert string to float:
2016-02-23 09:43:40,834 [STOP] SONOS.sonos.workflow.fixture.PollingIntervalTest - 1212827 PollingIntervalTest test_getlastupdate_no_change
2016-02-23 09:43:40,836 [DEBUG] SONOS.sonos.workflow.fixture.PollingIntervalTest - [('../../sonos-1.1.0.dev_r208947-py2.7.egg/sonos/workflow/fixture.py', 2494, '_run_test_iteration', 'testMethod()'), ('/Users/rob/Dropbox/dev/projects/composed/sonos_downloads/sonos-selftest/smapi/content_workflow/getlastupdate.py', 40, 'test_getlastupdate_no_change', 'poll_interval = self.smapiservice.get_polling_interval()'), ('../../sonos-1.1.0.dev_r208947-py2.7.egg/sonos/smapi/smapiservice.py', 374, 'get_polling_interval', "pollinterval = self.config.getfloat('Polling Interval', 'interval')")]
2016-02-23 09:43:40,836 [INFO] SONOS.sonos.workflow.fixture.PollingIntervalTest - - - - - - - - - - - - - - - - - - - - - - - - - -
2016-02-23 09:43:40,836 [INFO] SONOS.sonos.workflow.result - End *test case* test_getlastupdate_no_change at Tuesday, February 23, 2016 09:43 AM
Here's what my service returns:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1">
<soap:Body>
<tns:getLastUpdateResponse>
<getLastUpdateResult>
<catalog>2016-02-18 11:52:30</catalog>
<favorites>Rob-2016-02-18 12:01:00</favorites>
<pollInterval>30</pollInterval>
</getLastUpdateResult>
</tns:getLastUpdateResponse>
</soap:Body>
</soap:Envelope>
It seems virtually identical to the sample response in the Sonos API docs. You can see that pollInterval has no type information specified in the SOAP XML, so I'm struggling to see how this error is due to something I'm doing.
Am I doing something wrong, or could this be a problem with the test suite itself?

I believe this may be an issue with the selftest's handling of special characters, specifically ":", within token values. If possible, try returning simply an integer as specified in the sample response to see if this resolves the issue.

Related

Calling Karate feature file returns response object including multiple copies of previous response object of parent scenario

I am investigating exponential increase in JAVA heap size when executing complex scenarios especially with multiple reusable scenarios. This is my attempt to troubleshoot the issue with simple example and possible explanation to JVM heap usage.
Environment: Karate 1.1.0.RC4 | JDK 14 | Maven 3.6.3
Example: Download project, extract and execute maven command as per READEME
Observation: As per following example, if we call same scenario multiple times, response object grows exponentially since it includes response from previous called scenario along with copies of global variables.
#unexpected
Scenario: Not over-writing nested variable
* def response = call read('classpath:examples/library.feature#getLibraryData')
* string out = response
* def resp1 = response.randomTag
* karate.log('FIRST RESPONSE SIZE = ', out.length)
* def response = call read('classpath:examples/library.feature#getLibraryData')
* string out = response
* def resp2 = response.randomTag
* karate.log('SECOND RESPONSE SIZE = ', out.length)
Output:
10:26:23.863 [main] INFO c.intuit.karate.core.FeatureRuntime - scenario called at line: 9 by tag: getLibraryData
10:26:23.875 [main] INFO c.intuit.karate.core.FeatureRuntime - scenario called at line: 14 by tag: libraryData
10:26:23.885 [main] INFO com.intuit.karate - FIRST RESPONSE SIZE = 331
10:26:23.885 [main] INFO c.intuit.karate.core.FeatureRuntime - scenario called at line: 9 by tag: getLibraryData
10:26:23.894 [main] INFO c.intuit.karate.core.FeatureRuntime - scenario called at line: 14 by tag: libraryData
10:26:23.974 [main] INFO com.intuit.karate - SECOND RESPONSE SIZE = 1783
10:26:23.974 [main] INFO c.intuit.karate.core.FeatureRuntime - scenario called at line: 9 by tag: getLibraryData
10:26:23.974 [main] INFO c.intuit.karate.core.FeatureRuntime - scenario called at line: 14 by tag: libraryData
10:26:23.988 [main] INFO com.intuit.karate - THIRD RESPONSE SIZE = 8009
Do we really need to include response and global variables in the response of called feature file (non-shared scope)?
When we read large json file and call multiple reusable scenario files, each time copy of read json data gets added to response object. Is there way to avoid this behavior?
Is there a better way to script complex test using reusable scenarios without having multiple copies of same variables?
Okay, can you look at this issue:
https://github.com/intuit/karate/issues/1675
I agree we can optimize the response and global variables. Would be great if you can contribute code.

Cakephp 4 Linking 2 existing entities with belongstomany association

First of all, thank you for your patience. I am getting to grips with PHP coding after a long while. I have finished the famous Cake tutorial and am now continuing with what I know and creating new solutions.
I am creating a voting system. When the current user votes on a suggestion (sames as an article), a new entry needs to be saved in a related cross table between suggestions and users. I thought that the public function link() is the best way to do this. See the function in the ArticlesController below. However, I get an error message "Call to undefined method Authentication\Identity::isNew()". This suggests I have not taken care of some authorization around this call. Can anyone tell me what I missed? Or whether there is a better way to do this?
Note; I do know it looks strange that when I already have my one suggestion I am working through the suggestions table, but I could not find a way for one entity to directly link it to an associated entity (ie I found no link function for entities). It would be nice to hear if this can be done in a leaner way.
public function upvote($id = null)
{
$suggestion = $this->Suggestions->get($id);
$this->Authorization->skipAuthorization();
$user = $this->request->getAttribute('identity');
//Create link between current suggestions and current user in the suggestions_users table
$suggestionsTable = $this->getTableLocator()->get('Suggestions');
$suggestionsTable->Users->link($suggestion,[$user]);
if ($voteTable->save($vote)) {
// The foreign key value was set automatically.
$this->Flash->success(__('Your vote has been cast.'));
}
else {
$this->Flash->error(__('The vote could not be cast. Apologies for the technical issue.'));
}
}
Stack trace;
2020-11-12 13:46:52 Error: [Error] Call to undefined method Authentication\Identity::isNew() in C:\wamp64\www\cake\vendor\cakephp\authorization\src\IdentityDecorator.php on line 125
Stack Trace:
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\ORM\Association\BelongsToMany.php:1323
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\ORM\Association\BelongsToMany.php:864
- C:\wamp64\www\cake\src\Controller\SuggestionsController.php:143
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Controller\Controller.php:529
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Controller\ControllerFactory.php:79
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\BaseApplication.php:251
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:77
- C:\wamp64\www\cake\vendor\cakephp\authorization\src\Middleware\AuthorizationMiddleware.php:129
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\authentication\src\Middleware\AuthenticationMiddleware.php:122
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Routing\Middleware\RoutingMiddleware.php:166
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Middleware\CsrfProtectionMiddleware.php:156
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Middleware\BodyParserMiddleware.php:159
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Routing\Middleware\RoutingMiddleware.php:166
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Routing\Middleware\AssetMiddleware.php:68
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Error\Middleware\ErrorHandlerMiddleware.php:121
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\debug_kit\src\Middleware\DebugKitMiddleware.php:60
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:73
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Runner.php:58
- C:\wamp64\www\cake\vendor\cakephp\cakephp\src\Http\Server.php:90
- C:\wamp64\www\cake\webroot\index.php:40
Request URL: /suggestions/upvote/1
Referer URL: http://localhost:8000/cake/suggestions

How to use a SQL query to get the Progress OpenEdge database information, e.g. database version

How to use a SQL query to get the Progress OpenEdge database information, e.g. database version?
In MS SQL Server, we can use SELECT ##VERSION to get the database version information, but this doesn't work for Progress OpenEdge database.
Thanks
You can get the version somewhat indirectly by looking at _dbStatus._dbStatus-shmVers and then mapping that value onto the values listed in this kbase:
https://knowledgebase.progress.com/articles/Article/P39456
(A leading "64" means 64 bit.)
For instance, a shared memory version of 6412371 means that you have 64 bit 10.2b00, 13723 is 11.7.0 etc.
Obviously new releases will result in new shared memory versions so you may need to stay on top of the kbase.
But as of today the list is:
OpenEdge 11 Shared Memory Versions:
11.0.0 - 13019
11.1.0 - 13053
11.2.0 - 13102
11.2.1 - 13103
11.3.0 - 13205
11.3.1 - 13215
11.3.2 - 13217
11.3.3 - 13221
11.4.0 - 13312
11.5.0 - 13506
11.5.1 - 13507
11.6.0 - 13614
11.6.1 - 13614
11.6.2 - 13615
11.6.3 - 13615
11.7.0 - 13723
11.7.1 - 13723
OpenEdge 10 Shared Memory Versions:
10.0A00 - 10004
10.0B00 - 10036
10.0B01 - 10036
10.0B02 - 10036
10.0B03 - 10040
10.0B04 - 10042
10.1A00 - 10127
10.1A01 - 10129
10.1B00 - 10171
10.1B02 - 10173
10.1B03 - 10174
10.1C00 - 10212
10.1C01 - 10213
10.1C02 - 10213
10.1C03 - 10213
10.1C04 - 10215
10.2A00 - 12003
10.2A01 - 12008
10.2A02 - 12008
10.2A03 - 12009
10.2B00 - 12371
10.2B01 - 12372
10.2B02 - 12372
10.2B03 - 12372
10.2B04 - 12382
10.2B05 - 12383
10.2B06 - 12384
10.2B07 - 12385
10.2B08 - 12403
Progress 9.1D to 9.1E Shared Memory Versions:
9.1D00 - 9118
9.1D01 - 9122
9.1D02 - 9124
9.1D03 - 9124
9.1D04 - 9125
9.1D05 - 9126
9.1D06 - 9127
9.1D07 - 9128
9.1D08 - 9129
9.1E00 - 9135
9.1E01 - 9136
9.1E02 - 9171
9.1E03 - 9200
9.1E04 - 9200
Older Shared Memory Versions:
9.0x - 9000 +
8.0x - 8001 +
7.4x - 7400 +
7.3B - 7331 +
7.3A - 7301 +
7.2x - 70xx
7.1x - 70xx
7.0x - 70xx
6.3x - 63xx
6.2x - 6xx
5.2x - 3
There is not direct way as in MS SQL Server. But, as a workaround, you can define a procedure/user defined function (UDF) (if you are using 11.7) to get version. As you should write procedure/UDF in java, you can write some piece of code to get the version. For example, you can create a .p to get the version and call that .p from java code in procedure/UDF. In the .p file, you can use PROVERSION statement to get version. Later, you can call that procedure/UDF from SQL.

RavenDB Restore slow

I've been testing our DR Process for a new application and am finding that RavenDB restore is taking an unexpected and unacceptable amount of time. I need to know if there is something wrong with my process or if there is a way of improving performance.
For the 70MB database I am restoring it is taking > 8 hours.
After stopping the RavenDB Windows service I'm using the following command, after reading RavenDB documentation http://ravendb.net/docs/server/administration/backup-restore
d:\RavenDB\Server>Raven.Server.exe -src "D:\Backups\RavenDB\2013-11-25_2330\MyDatabase\RavenDB.Backup" -dest "D:\RavenDB\Server\Data
base\Databases\" -restore
I get progress reporting like this:
Request #10,306: POST - 72 ms - <system> - 201 - /admin/backup
Request #10,307: GET - 21 ms - <system> - 200 - /docs/Raven/Backup/Stat
us
Request #10,308: GET - 0 ms - <system> - 200 - /docs/Raven/Backup/Stat
us
Request #10,309: POST - 1,150 ms - MyDatabase - 201 - /admin/backup
Request #10,310: GET - 32 ms - MyDatabase - 200 - /docs/Raven/Backup/Status
etc
But have not yet had confirmation of successful restore.

serialization of Base64 string in JSON payload with HessianKit (Objective-C/Cocoa)

I'm trying to connect my iOS-App to an existing Grails backend server. The backend exposes a hessian webservice by using the grails remoting plugin (version 1.3). My Android app successfully calls all webservice methods.
My goal is to transmit a jpeg image from the phone to the server (works with the Android app). My approach is to use create a JSON object with JSONKit and include the image as a base64 encoded string. I'm using HessianKit in an XCode 4 project with ARC targeting iOS 4.2 and Nick Lockwood's NSData+Base64 categories for Base64 encoding (https://github.com/nicklockwood/Base64).
Here's my code:
NSMutableDictionary *jsonPayload = [NSMutableDictionary dictionary];
[jsonPayload setObject:[theImage base64EncodedString] forKey:#"photo"];
NSString* jsonString = [jsonPayload JSONString];
NSURL* url = server_URL;
id<BasicAPI> proxy = (id<BasicAPI>)[CWHessianConnection proxyWithURL:url protocol:#protocol(BasicAPI)];
[proxy addImage:jsonString];
The problem is that the server throws an expection when called by the app:
threw exception [Hessian skeleton invocation failed; nested exception is com.caucho.hessian.io.HessianProtocolException: addImage__1: expected string at 0x7b ({)] with root cause
Message: addImage__1: expected string at 0x7b ({)
Line | Method
->> 1695 | error in com.caucho.hessian.io.HessianInput
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1681 | expect in ''
| 1473 | parseChar in ''
| 792 | readString in ''
| 181 | readObject in com.caucho.hessian.io.BasicDeserializer
| 1078 | readObject in com.caucho.hessian.io.HessianInput
| 300 | invoke . . in com.caucho.hessian.server.HessianSkeleton
| 221 | invoke in ''
| 886 | runTask . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 680 | run . . . in java.lang.Thread
All other JSON payloads from my app (Strings, dates, numbers, etc.) can be deserialized by the server without any problem and the other way round, i.e. sending a base64 encoded image as json payload to the app from the server as a response also works.
After spending hours reading bug reports and mailing lists, I suspect that the problem might be that HessianKit only supports the Hessian 1 protocol but the hessian version shipped with remoting 1.3 is 4.0.7. 4.0.7 probably uses the Hessian 2 protocol and isn't compatible backwards. But that's just guessing.
EDIT: Actually, the issue has nothing to do with JSON. The same exception is thrown when I just pass the string as a normal string (and not embedded in JSON) to the webservice.
Has someone experienced a similar problem and knows a solution?