Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ignore this PR] Ci/investigate failing ubuntu test #2441

Closed
wants to merge 20 commits into from

Conversation

predragnikolic
Copy link
Member

No description provided.

jwortmann and others added 11 commits March 26, 2024 21:46
This fixes for example the Pyright warning
LSP-pyright: Received change text document command for closed file <URI>
when a file is saved and closed immediately after changes were applied.
view.change_count() returns 0 if the view isn't valid anymore (closed),
so we can simply use short-circuit evaluation for this and don't need
the is_valid() API call.
@predragnikolic
Copy link
Member Author

predragnikolic commented Apr 8, 2024

locally all tests pass in test_single_document.py, but not on CI

local logs:

test_did_change_before_did_close (test_single_document.AnotherDocumentTestCase) ... ok
test_apply_formatting (test_single_document.SingleDocumentTestCase) ... ok
test_apply_formatting_and_preserve_order (test_single_document.SingleDocumentTestCase) ... ok
test_declaration (test_single_document.SingleDocumentTestCase) ... ok
test_declaration_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_definition (test_single_document.SingleDocumentTestCase) ... ok
test_definition_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_did_change (test_single_document.SingleDocumentTestCase) ... ok
test_did_close (test_single_document.SingleDocumentTestCase) ... ok
test_did_open (test_single_document.SingleDocumentTestCase) ... ok
test_expand_selection (test_single_document.SingleDocumentTestCase) ... ok
test_formats_on_save (test_single_document.SingleDocumentTestCase) ... ok
test_hover_info (test_single_document.SingleDocumentTestCase) ... ok
test_implementation (test_single_document.SingleDocumentTestCase) ... ok
test_implementation_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_out_of_bounds_column_for_text_document_edit (test_single_document.SingleDocumentTestCase) ... ok
test_progress (test_single_document.SingleDocumentTestCase) ... ok
test_remove_line_and_then_insert_at_that_line_at_end (test_single_document.SingleDocumentTestCase) ... ok
test_rename (test_single_document.SingleDocumentTestCase) ... ok
test_run_command (test_single_document.SingleDocumentTestCase) ... ok
test_sends_save_with_purge (test_single_document.SingleDocumentTestCase) ... ok
test_tabs_are_respected_even_when_translate_tabs_to_spaces_is_set_to_true (test_single_document.SingleDocumentTestCase) ... ok
test_type_definition (test_single_document.SingleDocumentTestCase) ... ok
test_type_definition_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_will_save_wait_until (test_single_document.WillSaveWaitUntilTestCase) ... ok

----------------------------------------------------------------------
Ran 25 tests in 6.418s

OK

ci logs:

Wait for tests output.......
Start to read output...
test_did_change_before_did_close (test_single_document.AnotherDocumentTestCase) ... ok
test_apply_formatting (test_single_document.SingleDocumentTestCase) ... ok
test_apply_formatting_and_preserve_order (test_single_document.SingleDocumentTestCase) ... ok
test_declaration (test_single_document.SingleDocumentTestCase) ... ok
test_declaration_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_definition (test_single_document.SingleDocumentTestCase) ... ok
test_definition_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_did_change (test_single_document.SingleDocumentTestCase) ... FAIL
test_did_close (test_single_document.SingleDocumentTestCase) ... ok
test_did_open (test_single_document.SingleDocumentTestCase) ... ok
test_expand_selection (test_single_document.SingleDocumentTestCase) ... ok
test_formats_on_save (test_single_document.SingleDocumentTestCase) ... ok
test_hover_info (test_single_document.SingleDocumentTestCase) ... ok
test_implementation (test_single_document.SingleDocumentTestCase) ... ok
test_implementation_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_out_of_bounds_column_for_text_document_edit (test_single_document.SingleDocumentTestCase) ... ok
test_progress (test_single_document.SingleDocumentTestCase) ... ok
test_remove_line_and_then_insert_at_that_line_at_end (test_single_document.SingleDocumentTestCase) ... ok
test_rename (test_single_document.SingleDocumentTestCase) ... ok
test_run_command (test_single_document.SingleDocumentTestCase) ... ok
test_sends_save_with_purge (test_single_document.SingleDocumentTestCase) ... ok
test_tabs_are_respected_even_when_translate_tabs_to_spaces_is_set_to_true (test_single_document.SingleDocumentTestCase) ... ok
test_type_definition (test_single_document.SingleDocumentTestCase) ... ok
test_type_definition_location_link (test_single_document.SingleDocumentTestCase) ... ok
test_will_save_wait_until (test_single_document.WillSaveWaitUntilTestCase) ... ok

======================================================================
FAIL: test_did_change (test_single_document.SingleDocumentTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/.config/sublime-text/Packages/UnitTesting/unittesting/core/py33/case.py", line 38, in _executeTestPart
    yield from deferred
  File "/home/runner/.config/sublime-text/Packages/LSP/tests/test_single_document.py", line 108, in test_did_change
    'uri': filename_to_uri(TEST_FILE_PATH)
AssertionError: {'textDocument': {'uri': 'file:///home/runner/.config/sublime-text/Packages/LSP/ [truncated]... != {'textDocument': {'uri': 'file:///home/runner/.config/sublime-text/Packages/LSP/ [truncated]...
- {'contentChanges': [{'range': {'end': {'character': 0, 'line': 0},
?                                                     ^

+ {'contentChanges': [{'range': {'end': {'character': 1, 'line': 0},
?                                                     ^

-                                'start': {'character': 0, 'line': 0}},
-                      'rangeLength': 0,
-                      'text': 'A'},
-                     {'range': {'end': {'character': 1, 'line': 0},
                                 'start': {'character': 1, 'line': 0}},
                       'rangeLength': 0,
                       'text': 'B'},
                      {'range': {'end': {'character': 2, 'line': 0},
                                 'start': {'character': 2, 'line': 0}},
                       'rangeLength': 0,
                       'text': '\n'},
                      {'range': {'end': {'character': 0, 'line': 1},
                                 'start': {'character': 0, 'line': 1}},
                       'rangeLength': 0,
                       'text': '\U0001f642'},
                      {'range': {'end': {'character': 2, 'line': 1},
                                 'start': {'character': 2, 'line': 1}},
                       'rangeLength': 0,
                       'text': '\n'},
                      {'range': {'end': {'character': 0, 'line': 2},
                                 'start': {'character': 0, 'line': 2}},
                       'rangeLength': 0,
                       'text': 'D'}],
   'textDocument': {'uri': 'file:///home/runner/.config/sublime-text/Packages/LSP/tests/testfile.txt',
                    'version': 6}}

----------------------------------------------------------------------
Ran 25 tests in 3.837s

@predragnikolic
Copy link
Member Author

ok found a solution,
which just moves the failing test to a dedicated TextDocumentTestCase e0edb02

@predragnikolic predragnikolic deleted the ci/investigate-failing-ubuntu-test branch April 10, 2024 16:06
@predragnikolic
Copy link
Member Author

Just to document that this was investigated for #2438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants