Looks like the test is implicitly dependent on the iteration order of
ImmutableMap.  It's asserting each of the assisted methods in order, and
the assisted methods are coming from assistDataByMethod.values(), which is
an ImmutableMap<Method, AssistData>.  The Map is an ImmutableMap, so the
iteration order is the insertion order, and the insertion order is
dependent on factoryRawType.getMethods() (where factoryRawType here would
be AnimalFactory.class).

I'm kinda surprised the test isn't more flaky in general.  Since JDK7, the
order of getMethods() has more to do with the way memory is laid out then
anything else, which'd make sense that it'd be different on different
platforms.  The test should probably change to sort the values before
testing them, since the iteration order is undefined.

sam



On Sat, Sep 28, 2013 at 5:52 PM, Tim Boudreau <[email protected]> wrote:

> On Sat, Sep 28, 2013 at 3:18 PM, Sam Berlin <[email protected]> wrote:
>
>> Not a known problem -- we haven't had any issue with the tests.  The
>> links you pasted don't seem to give any test results (they give 404s).
>>  Could you paste the stack trace / failure here?
>>
>
> Hrm...you should be able to get there from
> http://builds.timboudreau.com/builds/job/Guice%203/ - click one of the
> build links on the left, then "Show all failed tests".
>
> Anyway, here you go:
>
> Error Message
>
> expected:<...AStrangeCatAsAnimal> but was:<...Cat>
>
> Stacktrace
>
> junit.framework.ComparisonFailure: expected:<...AStrangeCatAsAnimal> but 
> was:<...Cat>
>       at junit.framework.Assert.assertEquals(Assert.java:81)
>       at junit.framework.Assert.assertEquals(Assert.java:87)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.validateAssistedMethod(ExtensionSpiTest.java:134)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.validateCreateAStrangeCatAsAnimal(ExtensionSpiTest.java:94)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.validateVisitor(ExtensionSpiTest.java:83)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.testSpiOnVisitor(ExtensionSpiTest.java:70)
>
>
> ----------------
> Error Message
>
> expected:<...AStrangeCatAsAnimal> but was:<...Cat>
>
> Stacktrace
>
> junit.framework.ComparisonFailure: expected:<...AStrangeCatAsAnimal> but 
> was:<...Cat>
>       at junit.framework.Assert.assertEquals(Assert.java:81)
>       at junit.framework.Assert.assertEquals(Assert.java:87)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.validateAssistedMethod(ExtensionSpiTest.java:134)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.validateCreateAStrangeCatAsAnimal(ExtensionSpiTest.java:94)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.validateVisitor(ExtensionSpiTest.java:83)
>       at 
> com.google.inject.assistedinject.ExtensionSpiTest.testSpiOnElements(ExtensionSpiTest.java:60)
>
>  --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-guice.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to