lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Itamar Syn-Hershko <ita...@code972.com>
Subject Re: [3/4] git commit: Bypassing NRE in RandomizedContext
Date Tue, 05 Aug 2014 18:41:25 GMT
The problem isn't with AtLeast, it's with the randomized context thing. It
just isn't initialized properly or something. Can you uncomment
https://github.com/apache/lucene.net/commit/27d435b561aa6ba50038d265e0ca4f2802336725#diff-0
and try run the tests at TestArrayUtil.cs, you should see the failures.

Also, can you revert this change please:

-    <Reference Include="nunit.framework, Version=2.6.3.13283,
Culture=neutral, PublicKeyToken=96d09a1eb7f44a77,
processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
+    <Reference Include="nunit.framework">
+      <HintPath>..\..\build\vs2013\test\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
     </Reference>

(in Lucene.Net.Test.csproj)

We should use Nuget for managing dependencies, and this is just adding
friction

Thanks

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Author of RavenDB in Action <http://manning.com/synhershko/>


On Tue, Aug 5, 2014 at 9:30 PM, michael herndon <mherndon@michaelherndon.com
> wrote:

> I pulled down the code into a new folder just to ensure I didn’t have a
> mismatch in files between local and remote.
>
> Then I created a test case for AtLeast which passes on my local machine.
>
> Tested with:
>
>    -
>
>    Visual Studio 2013
>     -
>
>    NUnit GUI
>     - NUnit Visual Studio Test Adapter.
>
> Are there any differences in setup or how the tests are being executed?
>
> There is an AssertionException for ByteRefStore, but I did not get a Null
> Reference Exception.
>
> NUnit Results
>
> https://onedrive.live.com/redir?resid=3B3E28D66F984FD1!8686&authkey=!AMvqg3UFWlXirgg&v=3&ithint=photo%2cjpg
> ​
>
>
> On Mon, Aug 4, 2014 at 8:32 PM, Itamar Syn-Hershko <itamar@code972.com>
> wrote:
>
> > Michael, can you please have a look at this?
> >
> > AtLeast() seem to have never worked due to an NRE in the randomized
> context
> > you recently ported
> >
> >
> >
> https://github.com/apache/lucene.net/commit/23d1c0ac8604157b5975db4a8b34ac388b67c982
> >
> > --
> >
> > Itamar Syn-Hershko
> > http://code972.com | @synhershko <https://twitter.com/synhershko>
> > Freelance Developer & Consultant
> > Author of RavenDB in Action <http://manning.com/synhershko/>
> >
> >
> > On Tue, Aug 5, 2014 at 3:29 AM, <synhershko@apache.org> wrote:
> >
> > > Bypassing NRE in RandomizedContext
> > >
> > >
> > > Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
> > > Commit:
> http://git-wip-us.apache.org/repos/asf/lucenenet/commit/27d435b5
> > > Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/27d435b5
> > > Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/27d435b5
> > >
> > > Branch: refs/heads/branch_4x
> > > Commit: 27d435b561aa6ba50038d265e0ca4f2802336725
> > > Parents: bd24ffc
> > > Author: Itamar Syn-Hershko <itamar@code972.com>
> > > Authored: Tue Aug 5 03:25:53 2014 +0300
> > > Committer: Itamar Syn-Hershko <itamar@code972.com>
> > > Committed: Tue Aug 5 03:25:53 2014 +0300
> > >
> > > ----------------------------------------------------------------------
> > >  test/test-framework/LuceneTestCase.cs               | 3 ++-
> > >  test/test-framework/Randomized/RandomizedContext.cs | 7 ++-----
> > >  2 files changed, 4 insertions(+), 6 deletions(-)
> > > ----------------------------------------------------------------------
> > >
> > >
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/27d435b5/test/test-framework/LuceneTestCase.cs
> > > ----------------------------------------------------------------------
> > > diff --git a/test/test-framework/LuceneTestCase.cs
> > > b/test/test-framework/LuceneTestCase.cs
> > > index 8586c9c..0460700 100644
> > > --- a/test/test-framework/LuceneTestCase.cs
> > > +++ b/test/test-framework/LuceneTestCase.cs
> > > @@ -557,7 +557,8 @@ namespace Lucene.Net
> > >
> > >          public static int AtLeast(int minimum)
> > >          {
> > > -            return AtLeast(RandomizedContext.Current.Random, minimum);
> > > +            return AtLeast(new Random(), minimum);
> > > +            //return AtLeast(RandomizedContext.Current.Random,
> minimum);
> > >          }
> > >
> > >          /// <summary>
> > >
> > >
> > >
> >
> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/27d435b5/test/test-framework/Randomized/RandomizedContext.cs
> > > ----------------------------------------------------------------------
> > > diff --git a/test/test-framework/Randomized/RandomizedContext.cs
> > > b/test/test-framework/Randomized/RandomizedContext.cs
> > > index 69567be..9a8cad2 100644
> > > --- a/test/test-framework/Randomized/RandomizedContext.cs
> > > +++ b/test/test-framework/Randomized/RandomizedContext.cs
> > > @@ -46,7 +46,7 @@ namespace Lucene.Net.Randomized
> > >          private readonly ThreadGroup threadGroup;
> > >          private Type suiteClass;
> > >          private volatile Boolean isDisposed = false;
> > > -        private RandomizedRunner runner;
> > > +        private readonly RandomizedRunner runner;
> > >
> > >          public Type GetTargetType
> > >          {
> > > @@ -167,11 +167,8 @@ namespace Lucene.Net.Randomized
> > >              }
> > >          }
> > >
> > > -
> > > -
> > >          public void Dispose()
> > > -        {
> > > -            throw new NotImplementedException();
> > > +        {
> > >          }
> > >      }
> > >  }
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message