Skip to content

Commit c527f09

Browse files
committed
fix(tests): use single-line lua to avoid multi-document YAML output
tarantoolctl/tt processes a multi-line script line by line and emits a separate YAML document (---\n...\n) for each line. SnakeYAML's yaml.load() rejects multi-document streams with "expected a single document in the stream", which broke 3.x tests that piped the wait-for-stable script via echo. Put the script on a single line with ';' separators so the output is a single YAML document.
1 parent 84e2142 commit c527f09

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

tarantool-pooling/src/test/java/io/tarantool/pool/integration/BasePoolTest.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,14 @@ protected int getActiveConnectionsCount(TarantoolContainer<?> tt) {
9898
// 100-500 ms. Wait for it to stabilise (fiber.sleep yields the worker so it
9999
// can accept the pending connections) before reading the value.
100100
String lua =
101-
"local last = box.stat.net().CONNECTIONS.current\n"
102-
+ "for i = 1, 50 do\n"
103-
+ " require('fiber').sleep(0.05)\n"
104-
+ " local cur = box.stat.net().CONNECTIONS.current\n"
105-
+ " if cur == last then\n"
106-
+ " return cur - 1\n"
107-
+ " end\n"
108-
+ " last = cur\n"
109-
+ "end\n"
110-
+ "return last - 1";
101+
"local last = box.stat.net().CONNECTIONS.current;"
102+
+ " for i = 1, 50 do"
103+
+ " require('fiber').sleep(0.05);"
104+
+ " local cur = box.stat.net().CONNECTIONS.current;"
105+
+ " if cur == last then return cur - 1 end;"
106+
+ " last = cur;"
107+
+ " end;"
108+
+ " return last - 1";
111109
List<? extends Object> result = TarantoolContainerClientHelper.executeCommandDecoded(tt, lua);
112110
return (Integer) result.get(0);
113111
} catch (Exception e) {

0 commit comments

Comments
 (0)