junit java.nio.file.filesystemalreadyexistSexception

发布于 2025-02-07 18:50:46 字数 1171 浏览 1 评论 0原文

我正在制作使用Junit Launcher进行负载测试的软件。问题在于,我继续遇到以下警告警告:uri jar的错误扫描文件:...例外java.nio.nio.file.filesysyalreadyexistSexistsexception从junit发出<代码> jdk.zipfs/jdk.nio.zipfs.zipfs.zipfilesystemprovider.newfilesystem(zipfilesystemprovider.java:102) .java:57)。

我正在跨多个线程启动相同的测试。我相信问题是由.execute()每次执行测试发现的方法引起的,从而在Junit代码内导致竞赛条件。

我想知道当前是否有一种方法可以在JUNIT中执行一次测试发现,然后使用相同的testplan多次执行测试?如果没有,那么此问题是否有解决方案,使我可以调用.jar格式打包的测试用例)。

在我看来,Junit不再支持重复执行相同的测试计划 https:// github .com/junit-team/junit5/desiss/2379 每次都会强迫效率低下的测试发现发生,导致filesystyalreadyexistSexception。 junit中的以下课程可能不是线程安全 https://github.com/junit-team/junit5/blob/blob/main/junit-platform-commons/src/src/main/main/java/java/java/java/junit/平台/公共/util/collablepath.java

谢谢!

I am making a piece of software that runs a load test using the JUnit launcher. The problem is that I keep on encountering the following warning WARNING: Error scanning files for URI jar: ... with exception java.nio.file.FileSystemAlreadyExistsException emitted from the JUnit code base due to jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:102) at org.junit.platform.commons.util.CloseablePath.createForJarFileSystem(CloseablePath.java:57).

I am launching the same test across multiple threads. I believe the issue is caused by the .execute() method performing test discovery each time, causing a race condition inside the JUnit code.

I was wondering if there is there currently a way to perform test discovery once in JUnit and then use the same TestPlan to execute the test multiple times? If not is then is there a fix for this problem that allows me to invoke tests which are packaged in the .jar format (unzipping the test .jar is not feasible for my use case).

It seems to me that JUnit no longer supports executing the same test plan repeatedly https://github.com/junit-team/junit5/issues/2379 forcing inefficient test discovery to happen each time leading to the FileSystemAlreadyExistsException. The following class in JUnit may not be thread safe https://github.com/junit-team/junit5/blob/main/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文