Browse Source
Merge pull request #15216 from smatvienko-tb/fix/lwm2m-fw-update-flaky-test
Fix flaky Ota5LwM2MIntegrationTest.testFirmwareUpdateByObject5_Ok
pull/15226/head
Viacheslav Klimov
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
8 additions and
1 deletions
-
application/src/test/java/org/thingsboard/server/transport/lwm2m/client/FwLwM2MDevice.java
|
|
|
@ -171,7 +171,14 @@ public class FwLwM2MDevice extends BaseInstanceEnabler implements Destroyable { |
|
|
|
|
|
|
|
if (this.leshanClient != null) { |
|
|
|
log.info("Stop/reboot LwM2M client {}", this.leshanClient.getEndpoint(identity)); |
|
|
|
this.leshanClient.stop(false); |
|
|
|
try { |
|
|
|
this.leshanClient.stop(false); |
|
|
|
} catch (Exception stopEx) { |
|
|
|
// Leshan may throw NPE during CoAP observe-relation cleanup when the server
|
|
|
|
// reference is null (race condition in NotificationDataStore.toKey()).
|
|
|
|
// The client is still considered stopped at this point — proceed with restart.
|
|
|
|
log.warn("Exception during LwM2M client stop, proceeding with restart: {}", stopEx.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
log.info("Start after update fw LwM2M client {}", this.leshanClient.getEndpoint(identity)); |
|
|
|
this.leshanClient.start(); |
|
|
|
|