File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
integrationtests/java/com/aws/greengrass/integrationtests/e2e
main/java/com/aws/greengrass/mqttclient Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,8 @@ void beforeEach(ExtensionContext context) {
191191 ignoreExceptionUltimateCauseWithMessageSubstring (context , "The connection was closed unexpectedly" );
192192 ignoreExceptionUltimateCauseWithMessageSubstring (context ,
193193 "Old requests from the previous session are cancelled" );
194+ ignoreExceptionUltimateCauseWithMessageSubstring (context ,
195+ "client connection interrupted by user request" );
194196 }
195197
196198 @ BeforeAll
Original file line number Diff line number Diff line change 1818import org .junit .jupiter .api .Test ;
1919import org .junit .jupiter .api .Timeout ;
2020import org .junit .jupiter .api .extension .ExtendWith ;
21+ import org .junit .jupiter .api .extension .ExtensionContext ;
2122import software .amazon .awssdk .services .greengrassv2 .model .ComponentDeploymentSpecification ;
2223import software .amazon .awssdk .services .greengrassv2 .model .CreateDeploymentRequest ;
2324import software .amazon .awssdk .services .greengrassv2 .model .CreateDeploymentResponse ;
3738import static com .aws .greengrass .deployment .DeploymentStatusKeeper .PROCESSED_DEPLOYMENTS_TOPICS ;
3839import static com .aws .greengrass .lifecyclemanager .GreengrassService .RUNTIME_STORE_NAMESPACE_TOPIC ;
3940import static com .aws .greengrass .lifecyclemanager .GreengrassService .SERVICES_NAMESPACE_TOPIC ;
41+ import static com .aws .greengrass .testcommons .testutilities .ExceptionLogProtector .ignoreExceptionUltimateCauseWithMessageSubstring ;
4042import static org .junit .jupiter .api .Assertions .assertTrue ;
4143
4244@ ExtendWith (GGExtension .class )
@@ -48,7 +50,10 @@ protected MultipleDeploymentsTest() throws Exception {
4850 }
4951
5052 @ BeforeEach
51- void beforeEach () throws Exception {
53+ void beforeEach2 (ExtensionContext context ) throws Exception {
54+ // Depending on the order that we receive the jobs, we expect that the job may already be canceled, so this
55+ // exception is fine and we want the test to continue.
56+ ignoreExceptionUltimateCauseWithMessageSubstring (context , "finished with status CANCELED" );
5257 initKernel ();
5358 }
5459
Original file line number Diff line number Diff line change @@ -242,7 +242,8 @@ public synchronized CompletableFuture<SubscribeResponse> subscribe(Subscribe sub
242242 .thenApply (SubscribeResponse ::fromCrtSubAck )
243243 .whenComplete ((r , error ) -> {
244244 synchronized (this ) {
245- if (error == null && (r .getReasonCodes () == null || r .getReasonCodes ().stream ()
245+ if (error == null && r != null
246+ && (r .getReasonCodes () == null || r .getReasonCodes ().stream ()
246247 // reason codes less than or equal to 2 are positive responses
247248 .allMatch (i -> i <= 2 ))) {
248249 subscriptionTopics .add (subscribe );
@@ -254,11 +255,13 @@ public synchronized CompletableFuture<SubscribeResponse> subscribe(Subscribe sub
254255 if (error != null ) {
255256 l .cause (error );
256257 }
257- if (r .getReasonCodes () != null ) {
258- l .kv ("reasonCodes" , r .getReasonCodes ());
259- }
260- if (Utils .isNotEmpty (r .getReasonString ())) {
261- l .kv ("reason" , r .getReasonString ());
258+ if (r != null ) {
259+ if (r .getReasonCodes () != null ) {
260+ l .kv ("reasonCodes" , r .getReasonCodes ());
261+ }
262+ if (Utils .isNotEmpty (r .getReasonString ())) {
263+ l .kv ("reason" , r .getReasonString ());
264+ }
262265 }
263266 l .log ("Error subscribing to topic" );
264267 }
You can’t perform that action at this time.
0 commit comments