From e753d7157b7723dd3eb0e7000e4bb55e7f6e1c71 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Fri, 8 Jun 2018 09:09:49 +0200 Subject: Match in diameter_app_SUITE to identify an unexpected path See this failure in nightly test on one host, indicating that code:which/1 is returning something other than the expected path: === Ended at 2018-06-08 05:10:41 === Location: [{lists,nth,170}, {diameter_app_SUITE,app,265}, {diameter_app_SUITE,'-xref/1-fun-3-',214}, {lists,'-filter/2-lc$^0/1-0-',1286}, {diameter_app_SUITE,xref,214}, {test_server,ts_tc,1545}, {test_server,run_test_case_eval1,1063}, {test_server,run_test_case_eval,995}] === Reason: no function clause matching lists:nth(2,[]) (lists.erl, line 170) in function diameter_app_SUITE:app/1 (diameter_app_SUITE.erl, line 265) in call from diameter_app_SUITE:'-xref/1-fun-3-'/2 (diameter_app_SUITE.erl, line 214) in call from lists:'-filter/2-lc$^0/1-0-'/2 (lists.erl, line 1286) in call from diameter_app_SUITE:xref/1 (diameter_app_SUITE.erl, line 214) in call from test_server:ts_tc/3 (test_server.erl, line 1545) in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1063) in call from test_server:run_test_case_eval/9 (test_server.erl, line 995) --- lib/diameter/test/diameter_app_SUITE.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/diameter/test/diameter_app_SUITE.erl') diff --git a/lib/diameter/test/diameter_app_SUITE.erl b/lib/diameter/test/diameter_app_SUITE.erl index 71256020f5..3c1313c296 100644 --- a/lib/diameter/test/diameter_app_SUITE.erl +++ b/lib/diameter/test/diameter_app_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2015. All Rights Reserved. +%% Copyright Ericsson AB 2010-2018. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -262,7 +262,9 @@ app(Mod) -> preloaded -> "erts"; Path -> - unversion(lists:nth(3, lists:reverse(filename:split(Path)))) + %% match to identify an unexpectedly short path + {_, _, [_,_,_|_] = Split} = {Mod, Path, filename:split(Path)}, + unversion(lists:nth(3, lists:reverse(Split))) end. add_application(XRef, App) -> -- cgit v1.2.3