This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 168789 - Commit validation fails randomly
Summary: Commit validation fails randomly
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2009-07-20 03:10 UTC by _ tboudreau
Modified: 2009-07-23 07:48 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2009-07-20 03:10:47 UTC
Do a clean build on Win XP.  Run commit validation.  It fails with the message below.

Run commit validation again.  It (usually) passes.

Is something intermittently invoking hg during startup?  Or some build system issue?  At any rate it is annoying not to
be able to trust commit-validation - it should not contain intermittent failures.  Perhaps some test notices that the
nbbuild/testuserdir is under an hg repository or something?

No writes during startup. Writing any files to disk during start is inefficient and usualy unnecessary. Consider using
declarative registration in your layer.xml file, or delaying the initialization of the whole subsystem till it is really
used. In case it is necessary to perform the write, you can modify the 'allowed-file-write.txt' file in ide.kit module.
More details at http://wiki.netbeans.org/FitnessViaWhiteAndBlackList checkExec: cmd.exe java.lang.Exception at
org.netbeans.test.ide.CountingSecurityManager.checkExec(CountingSecurityManager.java:545) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:447) at
org.netbeans.modules.mercurial.util.HgCommand.execEnv(HgCommand.java:2644) at
org.netbeans.modules.mercurial.util.HgCommand.execForVersionCheck(HgCommand.java:2827) at
org.netbeans.modules.mercurial.util.HgCommand.getHgVersion(HgCommand.java:513) at
org.netbeans.modules.mercurial.Mercurial.checkVersionIntern(Mercurial.java:193) at
org.netbeans.modules.mercurial.Mercurial.access$000(Mercurial.java:79) at
org.netbeans.modules.mercurial.Mercurial$1.run(Mercurial.java:184) at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:602) at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1070) expected:<0> but was:<1>

junit.framework.AssertionFailedError: No writes during startup.
Writing any files to disk during start is inefficient and usualy unnecessary.
Consider using declarative registration in your layer.xml file, or delaying
the initialization of the whole subsystem till it is really used.
In case it is necessary to perform the write, you can modify the
'allowed-file-write.txt' file in ide.kit module. More details at
http://wiki.netbeans.org/FitnessViaWhiteAndBlackList
checkExec: cmd.exe
java.lang.Exception
at org.netbeans.test.ide.CountingSecurityManager.checkExec(CountingSecurityManager.java:545)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:447)
at org.netbeans.modules.mercurial.util.HgCommand.execEnv(HgCommand.java:2644)
at org.netbeans.modules.mercurial.util.HgCommand.execForVersionCheck(HgCommand.java:2827)
at org.netbeans.modules.mercurial.util.HgCommand.getHgVersion(HgCommand.java:513)
at org.netbeans.modules.mercurial.Mercurial.checkVersionIntern(Mercurial.java:193)
at org.netbeans.modules.mercurial.Mercurial.access$000(Mercurial.java:79)
at org.netbeans.modules.mercurial.Mercurial$1.run(Mercurial.java:184)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:602)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1070)
expected:<0> but was:<1>
at org.netbeans.test.ide.CountingSecurityManager.assertCounts(CountingSecurityManager.java:143)
at org.netbeans.test.ide.GeneralSanityTest.testNoWrites(GeneralSanityTest.java:102)
at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:88)
at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:336)
at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:273)
at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:355)
at org.netbeans.junit.NbTestCase.run(NbTestCase.java:213)
at org.netbeans.junit.NbModuleSuite$S.runInRuntimeContainer(NbModuleSuite.java:784)
at org.netbeans.junit.NbModuleSuite$S.run(NbModuleSuite.java:572)
Comment 1 Ondrej Vrabec 2009-07-20 18:26:42 UTC
I looked into CountingSecurityManager.checkExec, hg command is there on the whitelist. 
But i guess you are not using hg.exe but something like hg.bat which can't be called directly but through 'cmd.exe /C
hg.bat'. And because cmd.exe is not on the whitelist than checkExec assert will fail.
Comment 2 _ tboudreau 2009-07-20 19:34:29 UTC
Yes, I have locally built hg which runs from a batch script w/ cmd /c. I have to use it because of a Windows-specific
bug in the current binary release which is fixed in the current source code.

But what is strange is that *sometimes* it passes.

I am guessing cmd.exe should be added to the whitelist, although it is not a perfect solution since cmd.exe could be
used for some other thing which is unnecessary during startup.  

Better I guess would be if we can get the full command line of cmd.exe and use a regexp to see if it is running hg or
something else, but I don't know if we can do that.
Comment 3 Ondrej Vrabec 2009-07-22 10:10:59 UTC
fix: cdev #894051798fe2
thanks to yarda for the patch
Comment 4 Quality Engineering 2009-07-23 07:48:25 UTC
Integrated into 'main-golden', will be available in build *200907230201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/894051798fe2
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #168789 - Commit validation fails randomly
more accurate recognition of running hg process