Skip to content

Commit 9aa6aa7

Browse files
committed
Fix flakiness
1 parent 8da31c9 commit 9aa6aa7

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/test-type-description-service.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
'use strict';
1616

1717
const assert = require('assert');
18-
const assertUtils = require('./utils.js');
1918
const DistroUtils = require('../lib/distro.js');
2019
const rclnodejs = require('../index.js');
2120
const TypeDescriptionService = require('../lib/type_description_service.js');
@@ -63,22 +62,23 @@ describe('type description service test suite', function () {
6362
const GetTypeDescription =
6463
'type_description_interfaces/srv/GetTypeDescription';
6564
const client = node.createClient(GetTypeDescription, serviceName);
66-
return client.waitForService(60 * 1000).then((result) => {
67-
if (!result) {
68-
throw new Error('Service not available');
69-
}
70-
return new Promise((resolve) => {
71-
client.sendRequest(request, (response) => {
72-
assert.strictEqual(response.successful, true);
73-
assert.strictEqual(
74-
response.type_description.type_description.type_name,
75-
topicType
76-
);
77-
assert.notStrictEqual(response.type_sources.length, 0);
78-
resolve();
79-
});
65+
const result = await client.waitForService(30 * 1000);
66+
if (!result) {
67+
throw new Error('Service not available');
68+
}
69+
70+
const promise = new Promise((resolve) => {
71+
client.sendRequest(request, (response) => {
72+
assert.strictEqual(response.successful, true);
73+
assert.strictEqual(
74+
response.type_description.type_description.type_name,
75+
topicType
76+
);
77+
assert.notStrictEqual(response.type_sources.length, 0);
78+
resolve();
8079
});
8180
});
81+
await promise;
8282
});
8383

8484
it('Test type description service configured by parameter', function (done) {

0 commit comments

Comments
 (0)