Skip to content

Commit 9c940d1

Browse files
make CI failure with unexpected result
-- Initialize real result with optional empty so that test can wait for right result and pass.
1 parent b36439e commit 9c940d1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.github/workflows/tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ jobs:
463463
build \
464464
"
465465
- name: Run Discover Tests
466-
timeout-minutes: 65
466+
timeout-minutes: 10
467467
run: |
468468
scripts/run_in_build_env.sh \
469469
'./scripts/tests/run_java_test.py \
@@ -475,7 +475,7 @@ jobs:
475475
--factoryreset \
476476
'
477477
- name: Run Pairing Tests
478-
timeout-minutes: 65
478+
timeout-minutes: 10
479479
run: |
480480
scripts/run_in_build_env.sh \
481481
'./scripts/tests/run_java_test.py \

examples/java-matter-controller/java/src/com/matter/controller/Main.java

+2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ public static void main(String[] args) {
114114
commandManager.run(args);
115115
} catch (IllegalArgumentException e) {
116116
logger.log(Level.INFO, "Arguments init failed with exception: " + e.getMessage());
117+
System.exit(1);
117118
} catch (Exception e) {
118119
logger.log(Level.INFO, "Run command failed with exception: " + e.getMessage());
120+
System.exit(1);
119121
}
120122
controller.shutdownCommissioning();
121123
}

examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public final void register(String clusterName, ArrayList<Command> commandsList)
3636
mClusters.put(clusterName, commandsList);
3737
}
3838

39-
public final void run(String[] args) {
39+
public final void run(String[] args) throws Exception {
4040
Command command;
4141

4242
if (args.length < 1) {
@@ -102,8 +102,10 @@ public final void run(String[] args) {
102102
} catch (IllegalArgumentException e) {
103103
System.out.println("Run command failed with exception: " + e.getMessage());
104104
showCommand(args[0], command);
105+
throw e;
105106
} catch (Exception e) {
106107
logger.log(Level.INFO, "Run command failed with exception: " + e.getMessage());
108+
throw e;
107109
}
108110
}
109111

0 commit comments

Comments
 (0)