From 50cb98ecdd37b88a32465c51d1de97130d82b0de Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Tue, 17 Mar 2020 17:29:59 +0000 Subject: [PATCH] Resolve intermittent test failure the previous regex filter still allowed files with cdb in the body of the name (which can be true as filenames are guid based) --- test/end_to_end/testutil.erl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/end_to_end/testutil.erl b/test/end_to_end/testutil.erl index 00ad9ad..0fe9a66 100644 --- a/test/end_to_end/testutil.erl +++ b/test/end_to_end/testutil.erl @@ -881,16 +881,9 @@ restore_topending(RootPath, FileName) -> find_journals(RootPath) -> {ok, FNsA_J} = file:list_dir(RootPath ++ "/journal/journal_files"), - {ok, Regex} = re:compile(".*\.cdb"), - CDBFiles = lists:foldl(fun(FN, Acc) -> case re:run(FN, Regex) of - nomatch -> - Acc; - _ -> - [FN|Acc] - end - end, - [], - FNsA_J), + % Must not return a file with the .pnd extension + CDBFiles = + lists:filter(fun(FN) -> filename:extension(FN) == ".cdb" end, FNsA_J), CDBFiles. convert_to_seconds({MegaSec, Seconds, _MicroSec}) ->