⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.netbeans.modules.masterfs.filebasedfs.fileobjects;

import java.awt.GraphicsEnvironment;
import java.io.File;

import java.io.IOException;
Expand All @@ -26,6 +27,7 @@
import java.util.List;
import java.util.Stack;
import org.netbeans.junit.NbTestCase;
import org.netbeans.junit.RandomlyFails;
import org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem;
import org.netbeans.modules.masterfs.filebasedfs.naming.FileNaming;
import org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory;
Expand All @@ -49,6 +51,7 @@ public StatFilesTest(String testName) {

@Override
protected void setUp() throws java.lang.Exception {
GraphicsEnvironment.isHeadless(); // may cause file reads in a static initializer on linux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little more info would be good to be provided in this issue at least.

Copy link
Member Author

@mbien mbien Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those tests monitor file IO by counting reads/writes. This calls something directly and eagerly which also does file IO. This method would have been called later indirectly by unrelated JDK API which would fail the tests - or worse - fail tests based on JDK update release or order of execution

FileObjectFactory.WARNINGS = false;
clearWorkDir();
testFile = new File(getWorkDir(), "testLockFile.txt");
Expand Down Expand Up @@ -151,6 +154,7 @@ public void testGetChildrenCaches() throws IOException {
monitor.getResults().assertResult(1, StatFiles.READ);
}

@RandomlyFails // JDK update releases caused failures
public void testLockFile() throws IOException {
FileObject fobj = getFileObject(testFile);
monitor.reset();
Expand Down
Loading