@@ -50,11 +50,12 @@ func TestUpdateVMOptions(t *testing.T) {
5050		{"idea64.vmoptions (GITPOD_CPU_COUNT 2)" , "intellij" , map [string ]string {"INTELLIJ_VMOPTIONS" : "-Xmx4096m" , "GITPOD_CPU_COUNT" : "12" }, "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx4096m\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -XX:ActiveProcessorCount=12\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
5151		{"goland64.vmoptions" , "goland" , nil , "-Xms128m\n -Xmx750m\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx750m\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true" },
5252		{"idea64.vmoptions" , "intellij" , nil , "-Xms128m\n -Xmx750m\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx750m\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
53- 		{"idea64.vmoptions (INTELLIJ_VMOPTIONS env set)" , "intellij" , map [string ]string {"INTELLIJ_VMOPTIONS" : "-Xmx2048m" }, "-Xms128m\n -Xmx750m\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx2048m\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
54- 		{"idea64.vmoptions (INTELLIJ_VMOPTIONS env set)" , "intellij" , map [string ]string {"INTELLIJ_VMOPTIONS" : "-Xmx4096m" }, "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx4096m\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
55- 		{"idea64.vmoptions (INTELLIJ_VMOPTIONS env set)" , "intellij" , map [string ]string {"INTELLIJ_VMOPTIONS" : "-Xmx4096m -XX:MaxRAMPercentage=75" }, "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx4096m\n -XX:MaxRAMPercentage=75\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
56- 		{"goland64.vmoptions (GOLAND_VMOPTIONS env set with conflicting options)" , "goland" , map [string ]string {"GOLAND_VMOPTIONS" : "-ea -XX:+IgnoreUnrecognizedVMOptions -XX:MaxRAMPercentage=75 -XX:MaxRAMPercentage=50" }, "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -ea\n -XX:+IgnoreUnrecognizedVMOptions\n -XX:+UseContainerSupport\n -XX:MaxRAMPercentage=50" },
53+ 		{"idea64.vmoptions (INTELLIJ_VMOPTIONS env set)" , "intellij" , map [string ]string {"GITPOD_CPU_COUNT"  :  "" ,  " INTELLIJ_VMOPTIONS" : "-Xmx2048m" }, "-Xms128m\n -Xmx750m\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx2048m\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
54+ 		{"idea64.vmoptions (INTELLIJ_VMOPTIONS env set)" , "intellij" , map [string ]string {"GITPOD_CPU_COUNT"  :  "" ,  " INTELLIJ_VMOPTIONS" : "-Xmx4096m" }, "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx4096m\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
55+ 		{"idea64.vmoptions (INTELLIJ_VMOPTIONS env set)" , "intellij" , map [string ]string {"GITPOD_CPU_COUNT"  :  "" ,  " INTELLIJ_VMOPTIONS" : "-Xmx4096m -XX:MaxRAMPercentage=75" }, "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx4096m\n -XX:MaxRAMPercentage=75\n -Dsun.tools.attach.tmp.only=true\n -XX:+UseContainerSupport\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -Djdk.configure.existing=true" },
56+ 		{"goland64.vmoptions (GOLAND_VMOPTIONS env set with conflicting options)" , "goland" , map [string ]string {"GITPOD_CPU_COUNT"  :  "" ,  " GOLAND_VMOPTIONS" : "-ea -XX:+IgnoreUnrecognizedVMOptions -XX:MaxRAMPercentage=75 -XX:MaxRAMPercentage=50" }, "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true" , "-Xms128m\n -Xmx2g\n -Dsun.tools.attach.tmp.only=true\n -Dfreeze.reporter.profiling=false\n -Dgtw.disable.exit.dialog=true\n -ea\n -XX:+IgnoreUnrecognizedVMOptions\n -XX:+UseContainerSupport\n -XX:MaxRAMPercentage=50" },
5757	}
58+ 	os .Unsetenv ("GITPOD_CPU_COUNT" )
5859	for  _ , test  :=  range  tests  {
5960		// compare vmoptions string content equality (i.e. split into slices and compare ignore order) 
6061		lessFunc  :=  func (a , b  string ) bool  { return  a  <  b  }
0 commit comments