diff --git a/ycmd/tests/clangd/subcommands_test.py b/ycmd/tests/clangd/subcommands_test.py index 34bb8742f5..5920a5094c 100644 --- a/ycmd/tests/clangd/subcommands_test.py +++ b/ycmd/tests/clangd/subcommands_test.py @@ -543,6 +543,7 @@ def FixIt_Check_AutoExpand_Resolved( results ): } ) ) +@WithRetry() def RunRangedFixItTest( app, rng, expected, chosen_fixit = 0 ): contents = ReadFile( PathToTestFile( 'FixIt_Clang_cpp11.cpp' ) ) args = { @@ -616,7 +617,6 @@ def test_Subcommands_DefinedSubcommands( self, app ): } ) - @WithRetry() @SharedYcmd def test_Subcommands_ServerNotInitialized( self, app ): for cmd in [ @@ -646,6 +646,7 @@ def test_Subcommands_ServerNotInitialized( self, app ): with self.subTest( cmd = cmd ): completer = handlers._server_state.GetFiletypeCompleter( [ 'cpp' ] ) + @WithRetry() @patch.object( completer, '_ServerIsInitialized', return_value = False ) def Test( app, cmd, *args ): request = { @@ -1177,7 +1178,6 @@ def test_Subcommands_FixIt_all( self, app ): RunFixItTest( app, line, column, language, filepath, check ) - @WithRetry() @SharedYcmd def test_Subcommands_FixIt_Ranged( self, app ): for test in [ @@ -1237,7 +1237,6 @@ def test_Subcommands_FixIt_AlreadyResolved( self, app ): assert_that( actual, equal_to( expected ) ) - @WithRetry() @IsolatedYcmd( { 'clangd_args': [ '-hidden-features' ] } ) def test_Subcommands_FixIt_ClangdTweaks( self, app ): selection = { diff --git a/ycmd/tests/java/subcommands_test.py b/ycmd/tests/java/subcommands_test.py index f47be8e2f2..4304bfb768 100644 --- a/ycmd/tests/java/subcommands_test.py +++ b/ycmd/tests/java/subcommands_test.py @@ -155,6 +155,7 @@ def RunHierarchyTest( app, kind, direction, location, expected, code ): RunTest( app, test ) +@WithRetry() def RunFixItTest( app, description, filepath, @@ -679,7 +680,6 @@ def test_Subcommands_GoToReferences_NoReferences( self, app ): 'Cannot jump to location' ) ) - @WithRetry() @IsolatedYcmd( { 'extra_conf_globlist': PathToTestFile( 'multiple_projects', '*' ) } ) @@ -722,14 +722,11 @@ def test_Subcommands_GoToReferences_MultipleProjects( self, app ): 'com', 'test', 'TestWidgetImpl.java' ) - for desc, request, expect in [ + for desc, filepath, line, column, expect in [ ( 'GoToReferences works across multiple projects', - { - 'command': 'GoToReferences', - 'filepath': utils_java, - 'line_num': 5, - 'column_num': 22, - }, + utils_java, + 5, + 22, { 'response': requests.codes.ok, 'data': contains_inanyorder( @@ -739,12 +736,9 @@ def test_Subcommands_GoToReferences_MultipleProjects( self, app ): ) } ), ( 'GoToReferences works in an unrelated project at the same time', - { - 'command': 'GoToReferences', - 'filepath': abstract_test_widget, - 'line_num': 10, - 'column_num': 15, - }, + abstract_test_widget, + 10, + 15, { 'response': requests.codes.ok, 'data': contains_inanyorder( @@ -755,16 +749,15 @@ def test_Subcommands_GoToReferences_MultipleProjects( self, app ): ) } ), ]: - with self.subTest( desc = desc, request = request, expect = expect ): + with self.subTest( desc = desc, + filepath = filepath, + line = line, + column = column, + expect = expect ): filepath = request[ 'filepath' ] StartJavaCompleterServerWithFile( app, filepath ) - - RunTest( app, { - 'description': desc, - 'request': request, - 'expect': expect - } ) + RunGoToTest( app, desc, filepath, line, column, 'GoToReferences', expect ) @WithRetry() @@ -1102,7 +1095,6 @@ def test_Subcommands_RefactorRename_Unicode( self, app ): - @WithRetry() @SharedYcmd def test_Subcommands_FixIt_SingleDiag_MultipleOption_Insertion( self, app ): import os @@ -1259,7 +1251,6 @@ def test_Subcommands_FixIt_SingleDiag_MultipleOption_Insertion( self, app ): RunFixItTest( app, description, filepath, 19, column, fixits_for_line ) - @WithRetry() @SharedYcmd def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ): filepath = PathToTestFile( 'simple_eclipse_project', @@ -1327,7 +1318,6 @@ def test_Subcommands_FixIt_SingleDiag_SingleOption_Modify( self, app ): filepath, 27, 12, fixits ) - @WithRetry() @SharedYcmd def test_Subcommands_FixIt_SingleDiag_MultiOption_Delete( self, app ): filepath = PathToTestFile( 'simple_eclipse_project', @@ -1404,7 +1394,6 @@ def test_Subcommands_FixIt_SingleDiag_MultiOption_Delete( self, app ): filepath, 15, 29, fixits ) - @WithRetry() @SharedYcmd def test_Subcommands_FixIt_MultipleDiags( self, app ): for description, column, expect_fixits in [ @@ -1626,7 +1615,6 @@ def test_Subcommands_FixIt_Range( self, app ): ) - @WithRetry() @SharedYcmd def test_Subcommands_FixIt_NoDiagnostics( self, app ): filepath = PathToTestFile( 'simple_eclipse_project', @@ -1652,7 +1640,6 @@ def test_Subcommands_FixIt_NoDiagnostics( self, app ): 'chunks': instance_of( list ) } ) ) } ) ) - @WithRetry() @SharedYcmd def test_Subcommands_FixIt_Unicode( self, app ): fixits = has_entries( { @@ -1720,7 +1707,6 @@ def test_Subcommands_FixIt_Unicode( self, app ): TEST_JAVA, 13, 1, fixits ) - @WithRetry() @IsolatedYcmd() def test_Subcommands_FixIt_InvalidURI( self, app ): filepath = PathToTestFile( 'simple_eclipse_project', diff --git a/ycmd/tests/rust/subcommands_test.py b/ycmd/tests/rust/subcommands_test.py index 3a5d0118cc..3b422a1868 100644 --- a/ycmd/tests/rust/subcommands_test.py +++ b/ycmd/tests/rust/subcommands_test.py @@ -138,6 +138,7 @@ def RunHierarchyTest( app, kind, direction, location, expected, code ): RunTest( app, test ) +@WithRetry() def RunGoToTest( app, command, test, *, project_root = 'common' ): folder = PathToTestFile( project_root, 'src' ) filepath = os.path.join( folder, test[ 'req' ][ 0 ] ) @@ -423,7 +424,6 @@ def test_Subcommands_GoToType_Basic( self, app ): RunGoToTest( app, 'GoToType', test ) - @WithRetry() @SharedYcmd def test_Subcommands_GoTo( self, app ): for test, command in itertools.product( @@ -442,7 +442,6 @@ def test_Subcommands_GoTo( self, app ): RunGoToTest( app, command, test ) - @WithRetry() @SharedYcmd def test_Subcommands_GoToImplementation( self, app ): for test in [ @@ -456,7 +455,6 @@ def test_Subcommands_GoToImplementation( self, app ): RunGoToTest( app, 'GoToImplementation', test ) - @WithRetry() @SharedYcmd def test_Subcommands_GoToImplementation_Failure( self, app ): RunGoToTest( app, @@ -587,7 +585,6 @@ def test_Subcommands_FixIt_Basic( self, app ): } ) - @WithRetry() @IsolatedYcmd() def test_Subcommands_GoTo_WorksAfterChangingProject( self, app ): filepath = PathToTestFile( 'macro', 'src', 'main.rs' )