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

Bug computing file digest in mixed environments (windows-linux) #985

Open
manuelsanchezortiz opened this issue Oct 5, 2023 · 0 comments

Comments

@manuelsanchezortiz
Copy link

1. Describe the bug 🐞

nGrinder v. 3.5.8

All libraries are sent again; cached data is always refreshed in mixed environments, windows, linux.

File hashing calculation includes the file native path son a hash like this on windows:
\lib\sdclient-1.1.3-SNAPSHOT.jar:021d1f3049c13032c59bd63e29071d93

is on linux:
/lib/sdclient-1.1.3-SNAPSHOT.jar:021d1f3049c13032c59bd63e29071d93

So files are always different.

Also I don't no why, files are distributed to all agents, not only the linux one.

2. Reproduction steps

  1. Install nGrinder Controller, an Agent on Windows. Install another Agent in a Linux system
  2. Run any test with some library and/or resources
  3. See how files are distributed
  4. Repeat the same test. Files are distributed again to all agents

3. Environment

  • Controller
    • OS: Windows 10
    • Browser: Chrome
    • JDK version: 11
    • Controller version: 3.5.8
  • Agent
    • OS: Windows 10, Linux
    • JDK version: 1.8
    • Agent version: 3.9.1

4. Screenshots

I think the problem is here, because File.getPath() uses system depedent file.separator.

FileUtils.java
public static String getFileDigest(File baseDir, File file) {
try {
return getSubPath(baseDir.getPath(), file.getPath()) + ":" + getMd5(file);
} catch (IOException e) {
throw new NGrinderRuntimeException(e);
}
}

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

No branches or pull requests

1 participant