Skip to content

Commit

Permalink
test: Restore old behavior of timeout per script line (#6647)
Browse files Browse the repository at this point in the history
Effectively increases the timeout for each command run - multiline
commands must be explicitly declared as such.

Follow-up DH-18632
  • Loading branch information
niloc132 committed Feb 14, 2025
1 parent 0b2873d commit 7dfb0b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,21 @@ protected Promise<IdeSession> connect(TableSourceBuilder tables) {
}

private Promise<IdeSession> runAllScriptsInOrder(IdeSession session, List<String> code) {
String block = String.join("\n", code);
delayTestFinish(4000);
return session.runCode(block).then(ignore -> Promise.resolve(session));
Promise<IdeSession> result = Promise.resolve(session);
for (int i = 0; i < code.size(); i++) {
final int index = i;
result = result.then(ignore -> {
delayTestFinish(4000 + index);

return session.runCode(code.get(index));
}).then(r -> {
if (r.getError() != null) {
return Promise.reject(r.getError());
}
return Promise.resolve(session);
});
}
return result;
}

public IThenable.ThenOnFulfilledCallbackFn<IdeSession, JsTable> table(String tableName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class ChartDataTestGwt extends AbstractAsyncGwtTestCase {
"my_col_defs = {\"ID\": dht.int32, \"Value\": dht.string, \"Deleted\": dht.bool_}",
"ug = jpy.get_type('io.deephaven.engine.updategraph.impl.EventDrivenUpdateGraph').newBuilder('test').existingOrBuild()",
"exec_ctx = ExecutionContext(get_exec_ctx().j_object.withUpdateGraph(ug))",
"with exec_ctx:",
" input = input_table(col_defs=my_col_defs, key_cols=\"ID\")",
" result = input.without_attributes('InputTable').where(\"!Deleted\").sort(\"ID\")");
"with exec_ctx:\n" +
" input = input_table(col_defs=my_col_defs, key_cols=\"ID\")\n" +
" result = input.without_attributes('InputTable').where(\"!Deleted\").sort(\"ID\")");

@Override
public String getModuleName() {
Expand Down

0 comments on commit 7dfb0b0

Please sign in to comment.