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

Try to stabilize sealed class completion tests #8025

Closed

Conversation

mbien
Copy link
Member

@mbien mbien commented Dec 6, 2024

the new code completion tests added in #7966 have a high failure rate in CI. E.g https://github.com/apache/netbeans/actions/runs/12197542394?pr=8019 is still failing after 5 attempts.

I can't reproduce it locally unfortunately.

diff --git a/harness/nbjunit/src/org/netbeans/junit/NbTestCase.java b/harness/nbjunit/src/org/netbeans/junit/NbTestCase.java
index 2d9f96007c80..b70f164df48a 100644
--- a/harness/nbjunit/src/org/netbeans/junit/NbTestCase.java
+++ b/harness/nbjunit/src/org/netbeans/junit/NbTestCase.java
@@ -752,6 +752,8 @@ public static void assertFile(String message, File test, File pass, File diff, D
         } else {
             try {
                 if (diffImpl.diff(test, pass, diffFile)) {
+                    System.out.println("test: "+test+"\n"+Files.readString(test.toPath()));
+                    System.out.println("pass: "+pass+"\n"+Files.readString(pass.toPath()));
                     throw new AssertionFileFailedError(message+"\n diff: "+diffFile, null == diffFile ? "" : diffFile.getAbsolutePath());
                 }
             } catch (IOException e) {

showed

    [junit] test: /home/runner/work/netbeans/netbeans/java/java.completion/build/test/unit/work/o.n.m.j.c.J/ststfg/testSealedTypeSwitchTypeFilteringGuard.out
    [junit] I
    [junit] null
    [junit] com
    [junit] java
    [junit] javax
    [junit] org
    [junit] sun
    [junit] 
    [junit] pass: /home/runner/work/netbeans/netbeans/java/java.completion/build/test/unit/data/goldenfiles/org/netbeans/modules/java/completion/JavaCompletionTaskTest/17/sealedTypeSwitch.pass
    [junit] public static final EJ EJ.A
    [junit] public static final EJ EJ.B
    [junit] public static final EJ EJ.C
    [junit] CI
    [junit] CJ1
    [junit] CJ2
    [junit] EJ
    [junit] I
    [junit] J
    [junit] null
    [junit] com
    [junit] java
    [junit] javax
    [junit] org
    [junit] sun
    [junit] test
    [junit] 

which might indicate missed code scanning updates or other indexer race conditions

@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) CI continuous integration changes labels Dec 6, 2024
@mbien mbien force-pushed the ci-try-stabilize-sealed-completion-tests branch from 5966f80 to 39e8919 Compare December 6, 2024 14:08
@mbien mbien force-pushed the ci-try-stabilize-sealed-completion-tests branch from 3ff708e to 98784f3 Compare December 8, 2024 11:16
@mbien mbien added the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Dec 15, 2024
@mbien
Copy link
Member Author

mbien commented Dec 17, 2024

closing in favor of #8066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI continuous integration changes do not merge Don't merge this PR, it is not ready or just demonstration purposes. Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant