From d1cda6d1f05b672bc29bea5e84de6b0bb6815863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 19 Dec 2018 14:35:48 +0100 Subject: Get rid of duplicates in h2specd output I'm not sure what caused the duplicates to appear, but they should be gone now. --- test/h2specd_SUITE.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/h2specd_SUITE.erl') diff --git a/test/h2specd_SUITE.erl b/test/h2specd_SUITE.erl index de17341..7153a7b 100644 --- a/test/h2specd_SUITE.erl +++ b/test/h2specd_SUITE.erl @@ -68,7 +68,12 @@ receive_infinity(Port, Acc) -> receive {Port, {data, {eol, Line}}} -> ct:log("~ts", [Line]), - io:format(user, "~s~n", [Line]), + %% Somehow we may receive the same line multiple times. + %% We therefore only print if it's a line we didn't print before. + case lists:member(Line, Acc) of + false -> io:format(user, "~s~n", [Line]); + true -> ok + end, receive_infinity(Port, [Line|Acc]); {Port, Reason={exit_status, _}} -> ct:log("~ts", [[[L, $\n] || L <- lists:reverse(Acc)]]), -- cgit v1.2.3