Skip to content

Commit

Permalink
Bugfix: Updating UDS communication statistics, even in case of persis…
Browse files Browse the repository at this point in the history
…tent timeout events; Disabled sinon should interface
  • Loading branch information
MyHomeMyData committed Aug 18, 2024
1 parent 461b275 commit 8ae3c60
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ Yes, that is possible under certain conditions:
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
* (MyHomeMyData) Bugfix: Updating UDS communication statistics, even in case of persistent timeout events
* (MyHomeMyData) Disabled sinon should interface
* (MyHomeMyData) Fixes based on issues #55,#56
* (MyHomeMyData) Bugfix: Time delta between schedules of UDS workes was not working properly

Expand Down
2 changes: 2 additions & 0 deletions lib/canUds.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ class uds {
ctxLocal.stat.cntCommTimeout += 1;
ctxLocal.statCommFailed(ctxLocal, ctxLocal.data.did);
if (ctxLocal.callback) await ctxLocal.callback(ctxGlobal, ctxLocal, ['timeout', {'did':ctxLocal.data.did,'didInfo':{'id':'','len':0},'val':''}]);
// Store statistics to update timeout count (but do not include the event in the time values):
ctxLocal.storage.storeStatistics(ctxGlobal, ctxLocal, false);
await ctxLocal.setDidDone(ctxGlobal, 0);
}

Expand Down
12 changes: 6 additions & 6 deletions test/mocha.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ process.on('unhandledRejection', (e) => {

// enable the should interface with sinon
// and load chai-as-promised and sinon-chai by default
const sinonChai = require('sinon-chai');
const chaiAsPromised = require('chai-as-promised');
const { should, use } = require('chai');
//const sinonChai = require('sinon-chai');
//const chaiAsPromised = require('chai-as-promised');
//const { should, use } = require('chai');

should();
use(sinonChai);
use(chaiAsPromised);
//should();
//use(sinonChai);
//use(chaiAsPromised);

0 comments on commit 8ae3c60

Please sign in to comment.