Skip to content

Commit 1348851

Browse files
authored
test: Restore old behavior of timeout per script line (deephaven#6647)
Effectively increases the timeout for each command run - multiline commands must be explicitly declared as such. Follow-up DH-18632
1 parent 98fcedc commit 1348851

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

web/client-api/src/test/java/io/deephaven/web/client/api/AbstractAsyncGwtTestCase.java

+15-3
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,21 @@ protected Promise<IdeSession> connect(TableSourceBuilder tables) {
166166
}
167167

168168
private Promise<IdeSession> runAllScriptsInOrder(IdeSession session, List<String> code) {
169-
String block = String.join("\n", code);
170-
delayTestFinish(4000);
171-
return session.runCode(block).then(ignore -> Promise.resolve(session));
169+
Promise<IdeSession> result = Promise.resolve(session);
170+
for (int i = 0; i < code.size(); i++) {
171+
final int index = i;
172+
result = result.then(ignore -> {
173+
delayTestFinish(4000 + index);
174+
175+
return session.runCode(code.get(index));
176+
}).then(r -> {
177+
if (r.getError() != null) {
178+
return Promise.reject(r.getError());
179+
}
180+
return Promise.resolve(session);
181+
});
182+
}
183+
return result;
172184
}
173185

174186
public IThenable.ThenOnFulfilledCallbackFn<IdeSession, JsTable> table(String tableName) {

web/client-api/src/test/java/io/deephaven/web/client/api/widget/plot/ChartDataTestGwt.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public class ChartDataTestGwt extends AbstractAsyncGwtTestCase {
3333
"my_col_defs = {\"ID\": dht.int32, \"Value\": dht.string, \"Deleted\": dht.bool_}",
3434
"ug = jpy.get_type('io.deephaven.engine.updategraph.impl.EventDrivenUpdateGraph').newBuilder('test').existingOrBuild()",
3535
"exec_ctx = ExecutionContext(get_exec_ctx().j_object.withUpdateGraph(ug))",
36-
"with exec_ctx:",
37-
" input = input_table(col_defs=my_col_defs, key_cols=\"ID\")",
38-
" result = input.without_attributes('InputTable').where(\"!Deleted\").sort(\"ID\")");
36+
"with exec_ctx:\n" +
37+
" input = input_table(col_defs=my_col_defs, key_cols=\"ID\")\n" +
38+
" result = input.without_attributes('InputTable').where(\"!Deleted\").sort(\"ID\")");
3939

4040
@Override
4141
public String getModuleName() {

0 commit comments

Comments
 (0)