Skip to content

Commit 6de0536

Browse files
committed
Fix web-impl tests
1 parent ead66e2 commit 6de0536

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

toolbox/fdc3-for-web/fdc3-web-impl/test/features/heartbeat.feature

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ Feature: Heartbeat Messages Between Apps and Server
1010
Scenario: App Responds to heartbeats
1111
When "libraryApp/a1" is opened with connection id "a1"
1212
And "a1" sends validate
13-
And we wait for a period of "500" ms
13+
And we wait for a period of "400" ms
1414
And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_1"
15-
And we wait for a period of "500" ms
15+
And we wait for a period of "400" ms
1616
And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_2"
17-
And we wait for a period of "500" ms
17+
And we wait for a period of "400" ms
1818
And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_3"
19-
And we wait for a period of "500" ms
19+
And we wait for a period of "400" ms
2020
And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_4"
21-
And we wait for a period of "500" ms
22-
And "libraryApp/a1" sends a heartbeat response to eventUuid "a1_5"
23-
And we wait for a period of "500" ms
21+
And we wait for a period of "400" ms
2422
Then I test the liveness of "libraryApp/a1"
2523
Then "{result}" is true
2624
And messaging will have outgoing posts
@@ -38,11 +36,11 @@ Feature: Heartbeat Messages Between Apps and Server
3836
| a1 | Connected |
3937

4038
Scenario: App Doesn't Respond to heartbeats
41-
Apps are considered dead if they don't respond to a heartbeat request within 2 seconds
39+
Apps are considered dead if they don't respond to a heartbeat request within the timeout period
4240

4341
When "libraryApp/a1" is opened with connection id "a1"
4442
And "a1" sends validate
45-
And we wait for a period of "3000" ms
43+
And we wait for a period of "3500" ms
4644
Then I test the liveness of "libraryApp/a1"
4745
Then "{result}" is false
4846
And messaging will have outgoing posts
@@ -51,6 +49,12 @@ Feature: Heartbeat Messages Between Apps and Server
5149
| heartbeatEvent | a1 | libraryApp |
5250
| heartbeatEvent | a1 | libraryApp |
5351
| heartbeatEvent | a1 | libraryApp |
52+
| heartbeatEvent | a1 | libraryApp |
53+
| heartbeatEvent | a1 | libraryApp |
54+
| heartbeatEvent | a1 | libraryApp |
55+
| heartbeatEvent | a1 | libraryApp |
56+
| heartbeatEvent | a1 | libraryApp |
57+
| heartbeatEvent | a1 | libraryApp |
5458
And I shutdown the server
5559
And I get the heartbeat times
5660
Then "{result}" is empty

toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/generic.steps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Given('A newly instantiated FDC3 Server with heartbeat checking', function (this
122122
const d = new BasicDirectory(apps);
123123

124124
this.sc = new TestServerContext(this);
125-
this.server = new DefaultFDC3Server(this.sc, d, defaultChannels(), true, 2000, 2000);
125+
this.server = new DefaultFDC3Server(this.sc, d, defaultChannels(), true, 2000, 1000);
126126
});
127127

128128
When('I shutdown the server', function (this: CustomWorld) {

toolbox/fdc3-for-web/fdc3-web-impl/test/world/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { World, setWorldConstructor } from '@cucumber/cucumber';
1+
import { World, setWorldConstructor, After } from '@cucumber/cucumber';
22
import { TestServerContext } from '../support/TestServerContext';
33
import { DefaultFDC3Server } from '../../src/BasicFDC3Server';
44
import { BasicDirectory } from '../../src/directory/BasicDirectory';
@@ -10,3 +10,7 @@ export class CustomWorld extends World {
1010
}
1111

1212
setWorldConstructor(CustomWorld);
13+
14+
After(function (this: CustomWorld) {
15+
this.server.shutdown();
16+
});

0 commit comments

Comments
 (0)