Skip to content

Commit

Permalink
hotfix: move polaris-interface to dependencies (#99)
Browse files Browse the repository at this point in the history
* hotfix: move polaris-interface to dependencies

* longer timeout for dataitem subscription
  • Loading branch information
markusgraube authored Oct 29, 2019
1 parent 32c5144 commit ce30cff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@p2olab/polaris-backend",
"version": "2.0.2",
"version": "2.0.3",
"main": "./build/src/index.js",
"types": "./build/src/index.d.ts",
"description": "Server backend for POL recipe execution engine",
Expand All @@ -27,6 +27,7 @@
"assets"
],
"dependencies": {
"@p2olab/polaris-interface": "^2.3.0",
"assign-deep": "^1.0.1",
"command-line-args": "^5.1.1",
"command-line-usage": "^6.0.2",
Expand All @@ -46,7 +47,6 @@
"yn": "^3.1.1"
},
"devDependencies": {
"@p2olab/polaris-interface": "^2.3.0",
"@types/body-parser": "^1.17.1",
"@types/chai": "^4.2.4",
"@types/chai-as-promised": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/model/dataAssembly/DataItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class OpcUaDataItem<T> extends DataItem<T> {
await this.read();
}
const monitoredItem = await timeout(
this.connection.listenToOpcUaNode(this.nodeId, this.namespaceIndex, samplingInterval), 1000);
this.connection.listenToOpcUaNode(this.nodeId, this.namespaceIndex, samplingInterval), 2000);
monitoredItem.on('changed', (dataValue) => {
this.logger.debug(`[${this.connection.id}] Variable Changed (${this.nodeId}) ` +
`= ${dataValue.value.value.toString()}`);
Expand Down
11 changes: 5 additions & 6 deletions test/model/recipe/Operation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ describe('Operation', () => {
}, [module]);

operation.execute();
await delay(300);
await delay(200);
expect(operation.json()).to.have.property('state', 'executing');
// set precondition for operation
service.executeCommand(ServiceCommand.start);

await service.waitForStateChangeWithTimeout('COMPLETED', 3000);
expect(operation.json()).to.have.property('state', 'completed');

}).timeout(10000);
}).timeout(3000);

it('should try execute operation until it is stopped', async () => {
const operation = new Operation({
Expand All @@ -167,12 +167,12 @@ describe('Operation', () => {
}, [module]);

operation.execute();
await delay(600);
await delay(200);
expect(operation.json()).to.have.property('state', 'executing');
operation.stop();
expect(operation.json()).to.have.property('state', 'aborted');

}).timeout(10000);
});

it('should try execute operation until timeout', async () => {
const operation = new Operation({
Expand All @@ -186,8 +186,7 @@ describe('Operation', () => {
await delay(2050);
expect(operation.json()).to.have.property('state', 'aborted');

}).timeout(10000);

}).timeout(8000);
});

});

0 comments on commit ce30cff

Please sign in to comment.