mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix handling of too many pending messages in SORT node (#1514)
* initial support of SORT node minor fix of sort node fixed error message of sort node fixed error handling of SORT node add test case for SORT node make limit of messages count computed once in SORT node * update type in message & info description * fix handling of pending messages in SORT node
This commit is contained in:
committed by
Dave Conway-Jones
parent
b98d1216b1
commit
d7c8adfd82
@@ -207,4 +207,26 @@ describe('SORT node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should clear pending messages on close', function(done) {
|
||||
var flow = [{id:"n1", type:"sort", order:"ascending", as_num:false, keyType:"payload", wires:[["n2"]]},
|
||||
{id:"n2", type:"helper"}];
|
||||
helper.load(sortNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
setTimeout(function() {
|
||||
var logEvents = helper.log().args.filter(function (evt) {
|
||||
return evt[0].type == "sort";
|
||||
});
|
||||
var evt = logEvents[0][0];
|
||||
evt.should.have.property('id', "n1");
|
||||
evt.should.have.property('type', "sort");
|
||||
evt.should.have.property('msg', "sort.clear");
|
||||
done();
|
||||
}, 150);
|
||||
var msg = { payload: 0,
|
||||
parts: { id: "X", index: 0, count: 2} };
|
||||
n1.receive(msg);
|
||||
n1.close();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user