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

Experimental test runner failure #3744

Closed
ericzundel opened this issue Aug 2, 2016 · 9 comments
Closed

Experimental test runner failure #3744

ericzundel opened this issue Aug 2, 2016 · 9 comments
Assignees

Comments

@ericzundel
Copy link
Member

Two of our test suites are failing with errors like this with the experimental runner enabled. in 1.1.0-rc9

                     1) Test mechanism
                     java.lang.NullPointerException
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.AntJunitXmlReportListener.testStarted(AntJunitXmlReportListener.java:377)
                        at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
                        at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
                        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
                        at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
                        at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
                        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:323)
                        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
                        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
                        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
                        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
                        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
                        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at org.junit.runners.Suite.runChild(Suite.java:128)
                        at org.junit.runners.Suite.runChild(Suite.java:27)
                        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
                        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
                        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
                        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.CompositeRequestRunner.runChild(CompositeRequestRunner.java:66)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1$1.run(ConcurrentCompositeRequestRunner.java:37)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentRunnerScheduler.finished(ConcurrentRunnerScheduler.java:91)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1.evaluate(ConcurrentCompositeRequestRunner.java:46)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.runLegacy(ConsoleRunnerImpl.java:544)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.runExperimental(ConsoleRunnerImpl.java:519)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.run(ConsoleRunnerImpl.java:458)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.main(ConsoleRunnerImpl.java:845)
                        at org.pantsbuild.tools.junit.ConsoleRunner.main(ConsoleRunner.java:12)
                     2) Test mechanism
                     java.lang.RuntimeException: No TestCase for 'com.squareup.starlog.consumer.spool2.SpoolStoreTest#absentFile[[com.squareup.starlog.consumer.spool2.CryptographerCodec@61f26cba]]'
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.AntJunitXmlReportListener.testFinished(AntJunitXmlReportListener.java:466)
                        at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:56)
                        at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:190)
                        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
                        at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:187)
                        at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
                        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:331)
                        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
                        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
                        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
                        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
                        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
                        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at org.junit.runners.Suite.runChild(Suite.java:128)
                        at org.junit.runners.Suite.runChild(Suite.java:27)
                        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
                        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
                        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
                        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.CompositeRequestRunner.runChild(CompositeRequestRunner.java:66)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1$1.run(ConcurrentCompositeRequestRunner.java:37)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentRunnerScheduler.finished(ConcurrentRunnerScheduler.java:91)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1.evaluate(ConcurrentCompositeRequestRunner.java:46)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.runLegacy(ConsoleRunnerImpl.java:544)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.runExperimental(ConsoleRunnerImpl.java:519)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.run(ConsoleRunnerImpl.java:458)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.main(ConsoleRunnerImpl.java:845)
                        at org.pantsbuild.tools.junit.ConsoleRunner.main(ConsoleRunner.java:12)
@jebbench
Copy link
Contributor

jebbench commented Jan 8, 2018

We're having the same problem for one of our parametrised tests:

Pants version: 1.4.0.dev24

There were 2 failures:
                     1) Test mechanism
                     java.lang.NullPointerException
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.AntJunitXmlReportListener.testStarted(AntJunitXmlReportListener.java:381)
                        at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
                        at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
                        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
                        at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
                        at org.junit.internal.runners.model.EachTestNotifier.fireTestStarted(EachTestNotifier.java:42)
                        at junitparams.internal.ParameterisedTestMethodRunner.runMethodInvoker(ParameterisedTestMethodRunner.java:45)
                        at junitparams.internal.ParameterisedTestMethodRunner.runTestMethod(ParameterisedTestMethodRunner.java:40)
                        at junitparams.internal.ParameterisedTestClassRunner.runParameterisedTest(ParameterisedTestClassRunner.java:146)
                        at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:417)
                        at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:386)
                        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
                        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
                        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
                        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
                        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
                        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.CompositeRequestRunner.runChild(CompositeRequestRunner.java:66)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1$1.run(ConcurrentCompositeRequestRunner.java:37)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentRunnerScheduler.finished(ConcurrentRunnerScheduler.java:91)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1.evaluate(ConcurrentCompositeRequestRunner.java:46)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.runLegacy(ConsoleRunnerImpl.java:539)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.run(ConsoleRunnerImpl.java:455)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.main(ConsoleRunnerImpl.java:843)
                        at org.pantsbuild.tools.junit.ConsoleRunner.main(ConsoleRunner.java:12)
                     2) Test mechanism
                     java.lang.RuntimeException: No TestCase for 'work.faber.device.dal.MongoDeviceStoreIntegration#[3] [Document{{deviceId=a5fdd2eb-c08e-47a6-b036-3fd723d9b132, platform=ios, userUuid=c05d140f-51f7-4be8-a009-8a3022cafa41, createdAt=Mon Jan 08 14:53:19 GMT 2018}}, Document{{deviceId=92d35b90-24ed-4156-bf3b-1f82e077018c, platform=android, userUuid=8b7e76cf-7d86-40d2-b0b4-e8ed3e755eeb, createdAt=Mon Jan 08 13:53:19 GMT 2018}}, Document{{deviceId=026c4107-693e-4957-a716-b67859952d3e, platform=ios, userUuid=c49275c7-fb83-4f9f-a750-a3d265eceef3, createdAt=Mon Jan 08 12:53:19 GMT 2018}}, Document{{deviceId=8acd4a2e-f06d-436b-a171-c3a6b376bbba, platform=android, userUuid=344131da-6af6-452b-82e1-e2e1dfe59baa, createdAt=Mon Jan 08 11:53:19 GMT 2018}}, Document{{deviceId=ca24acfe-f5a3-4f78-9099-da06f307d984, platform=ios, userUuid=bd707445-af73-4029-a068-01bf873b61b1, createdAt=Mon Jan 08 10:53:19 GMT 2018}}, Document{{deviceId=52a167c6-cf17-40b6-8167-6c56dccbaacb, platform=android, userUuid=8add2792-a050-4e38-8ba0-040182e55d13, createdAt=Mon Jan 08 09:53:19 GMT 2018}}, Document{{deviceId=5ddc7160-a40b-4b74-981f-3002074de018, platform=ios, userUuid=2f25f189-f2dc-45a0-881b-ebe9e491422d, createdAt=Mon Jan 08 08:53:19 GMT 2018}}, Document{{deviceId=b4276f46-d03c-4724-b68c-7eae23294dd6, platform=android, userUuid=b10776e1-2129-4822-9bd0-90b989a88137, createdAt=Mon Jan 08 07:53:19 GMT 2018}}, Document{{deviceId=85527789-b23c-4d16-90dd-d18682facc53, platform=ios, userUuid=876aebab-5178-4989-8933-9d85ecf000ff, createdAt=Mon Jan 08 06:53:19 GMT 2018}}, Document{{deviceId=22fb1d17-b2c2-4ecb-ac7d-c8b18f000cd8, platform=android, userUuid=ec43919f-1923-4fe3-94d3-4cf2a50ee4c5, createdAt=Mon Jan 08 05:53:19 GMT 2018}}], FlowableJust, [Document{{deviceId=a5fdd2eb-c08e-47a6-b036-3fd723d9b132, platform=ios, userUuid=777b9bb5-1903-4496-8258-905321301e2b, createdAt=Mon Jan 08 14:53:19 GMT 2018}}, Document{{deviceId=92d35b90-24ed-4156-bf3b-1f82e077018c, platform=android, userUuid=8b7e76cf-7d86-40d2-b0b4-e8ed3e755eeb, createdAt=Mon Jan 08 13:53:19 GMT 2018}}, Document{{deviceId=026c4107-693e-4957-a716-b67859952d3e, platform=ios, userUuid=c49275c7-fb83-4f9f-a750-a3d265eceef3, createdAt=Mon Jan 08 12:53:19 GMT 2018}}, Document{{deviceId=8acd4a2e-f06d-436b-a171-c3a6b376bbba, platform=android, userUuid=344131da-6af6-452b-82e1-e2e1dfe59baa, createdAt=Mon Jan 08 11:53:19 GMT 2018}}, Document{{deviceId=ca24acfe-f5a3-4f78-9099-da06f307d984, platform=ios, userUuid=bd707445-af73-4029-a068-01bf873b61b1, createdAt=Mon Jan 08 10:53:19 GMT 2018}}, Document{{deviceId=52a167c6-cf17-40b6-8167-6c56dccbaacb, platform=android, userUuid=8add2792-a050-4e38-8ba0-040182e55d13, createdAt=Mon Jan 08 09:53:19 GMT 2018}}, Document{{deviceId=5ddc7160-a40b-4b74-981f-3002074de018, platform=ios, userUuid=2f25f189-f2dc-45a0-881b-ebe9e491422d, createdAt=Mon Jan 08 08:53:19 GMT 2018}}, Document{{deviceId=b4276f46-d03c-4724-b68c-7eae23294dd6, platform=android, userUuid=b10776e1-2129-4822-9bd0-90b989a88137, createdAt=Mon Jan 08 07:53:19 GMT 2018}}, Document{{deviceId=85527789-b23c-4d16-90dd-d18682facc53, platform=ios, userUuid=876aebab-5178-4989-8933-9d85ecf000ff, createdAt=Mon Jan 08 06:53:19 GMT 2018}}, Document{{deviceId=22fb1d17-b2c2-4ecb-ac7d-c8b18f000cd8, platform=android, userUuid=ec43919f-1923-4fe3-94d3-4cf2a50ee4c5, createdAt=Mon Jan 08 05:53:19 GMT 2018}}] (saveDevices_createsDevices)'
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.AntJunitXmlReportListener.testFinished(AntJunitXmlReportListener.java:478)
                        at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:56)
                        at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:190)
                        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
                        at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:187)
                        at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
                        at junitparams.internal.ParameterisedTestMethodRunner.runMethodInvoker(ParameterisedTestMethodRunner.java:53)
                        at junitparams.internal.ParameterisedTestMethodRunner.runTestMethod(ParameterisedTestMethodRunner.java:40)
                        at junitparams.internal.ParameterisedTestClassRunner.runParameterisedTest(ParameterisedTestClassRunner.java:146)
                        at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:417)
                        at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:386)
                        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
                        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
                        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
                        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
                        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
                        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.CompositeRequestRunner.runChild(CompositeRequestRunner.java:66)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1$1.run(ConcurrentCompositeRequestRunner.java:37)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentRunnerScheduler.finished(ConcurrentRunnerScheduler.java:91)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1.evaluate(ConcurrentCompositeRequestRunner.java:46)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.runLegacy(ConsoleRunnerImpl.java:539)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.run(ConsoleRunnerImpl.java:455)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.main(ConsoleRunnerImpl.java:843)
                        at org.pantsbuild.tools.junit.ConsoleRunner.main(ConsoleRunner.java:12)
                     
                     FAILURES!!!
                     Tests run: 2392,  Failures: 2
                     
                     
FAILURE: 
java org.pantsbuild.tools.junit.ConsoleRunner ... exited non-zero (1); 0 failed 0 targets.

I can comment out the parameter below and the tests all pass:

new Object[]{ // UPSERT PopulatedDb, insert 1, expect 10
        BsonDeviceFixture.getDocuments(10),
        Flowable.just(ProtobufDevice.newBuilder(getProtobufDevice(0)).setUserUuid(updatedUserUuid).build()),
        BsonDeviceFixture.getDocuments(10).stream()
          .peek(bson -> {
            if (bson.get(DeviceBsonKeys.J_USER_UUID).equals(getUserUUID(0))) {
              bson.put(DeviceBsonKeys.J_USER_UUID, updatedUserUuid);
            }
          })
          .collect(Collectors.toList())
      }

All of the tests pass in Intellij and with --test-junit-parallel-threads=1 set.

@jsirois
Copy link
Contributor

jsirois commented Jan 8, 2018

@jebbench can you give a bit more context on the new Object[]{...} parameter? What is the full structure of this junit test, is it using https://github.com/junit-team/junit4/wiki/parameterized-tests? The NPE might make sense in this sort of context and if so, we could get a small repro test that fails to start work on fixing this.

@jebbench
Copy link
Contributor

jebbench commented Jan 8, 2018

I'll try and put together a small project that replicates this; I'm not sure how easy it will be to do though as we're doing things very similarly in other tests that are working fine.

@jebbench
Copy link
Contributor

jebbench commented Jan 8, 2018

I think I'm going to struggle to replicate this - I've torn out the logic of the test and replace the DB with a map and it works as expected.

To give some context we're using https://github.com/Pragmatists/JUnitParams to create parametrised tests that test our DAL writes/reads to Mongo as expected (i.e. test our queries give back the results we expect).

MONGO_HELPER a helper class for setting up Mongo for tests - creates a new DB for each test and helper methods to insert/read from Mongo.
deviceStore a DAL that uses Mongo as it's persistent store (for device ids for push notifications in this case).
BsonDeviceFixture.getDocument(int seed) gets a BSON (Mongo) document; passing the same seed will always return the same document.
getProtobufDevice(int seed) gets a Protobuf Device entity; the seeds match the BSON seeds (i.e. the values for 0 passed here are the same as in the Bson fixture).
BsonDeviceFixture.getDocuments(int count) - returns a list of BSON documents using seeds from 0 to count - 1;
getProtobufDevices(int count) - returns a list of Device entities using seeds from 0 to count -1;

The test that fails:

@Test
  @Parameters(method = "validSaves")
  public void saveDevices_createsDevices(List<Document> fixture, Flowable<ProtobufDevice> insert, List<BsonDocument> expect) throws Exception {
    MONGO_HELPER.insert(collection, fixture);

    deviceStore.saveDevices(insert).test().await().assertComplete();

    List<Document> result = MONGO_HELPER.getBson(collection, new Document());
    assertThat(result).isEqualTo(expect);
  }

The Parameters we pass:

@SuppressWarnings("unused")
  private Object validSaves() {
    String updatedUserUuid = UUID.randomUUID().toString();
    return new Object[]{
      new Object[]{ // INSERT Empty database, insert 1, expect 1
        Collections.EMPTY_LIST,
        Flowable.just(getProtobufDevice(0)),
        Collections.singletonList(BsonDeviceFixture.getDocument(0))
      },
      new Object[]{ // INSERT PopulatedDb, insert 1, expect 11
        BsonDeviceFixture.getDocuments(10),
        Flowable.just(getProtobufDevice(10)), // 0 Index
        BsonDeviceFixture.getDocuments(11)
      },
      new Object[]{ // INSERT PopulatedDb, insert 100, expect 100
        BsonDeviceFixture.getDocuments(10),
        Flowable.fromIterable(getProtobufDevices(100)),
        BsonDeviceFixture.getDocuments(100)
      },
// TODO: https://github.com/pantsbuild/pants/issues/3744
//      new Object[]{ // UPSERT PopulatedDb, insert 1, expect 10
//        BsonDeviceFixture.getDocuments(10),
//        Flowable.just(ProtobufDevice.newBuilder(getProtobufDevice(0)).setUserUuid(updatedUserUuid).build()),
//        BsonDeviceFixture.getDocuments(10).stream()
//          .peek(bson -> {
//            if (bson.get(DeviceBsonKeys.J_USER_UUID).equals(getUserUUID(0))) {
//              bson.put(DeviceBsonKeys.J_USER_UUID, updatedUserUuid);
//            }
//          })
//          .collect(Collectors.toList())
//      }
    };
  }

@jsirois
Copy link
Contributor

jsirois commented Jan 8, 2018

Thanks @jebbench - that's much better than nothing. I'll take a poke at replicating this over the next few days.

@jsirois jsirois self-assigned this Jan 10, 2018
jsirois added a commit to jsirois/pants that referenced this issue Jan 10, 2018
@jsirois
Copy link
Contributor

jsirois commented Jan 10, 2018

Gave this some spins, no repro yet. Work here: master...jsirois:issues/3744

@jebbench
Copy link
Contributor

So this is only an issue if the test passes - if it fails then Pants behaves as expected.

Updating my parameter to:

      new Object[]{ // UPSERT PopulatedDb, insert 1, expect 10
        BsonDeviceFixture.getDocuments(10),
        Flowable.just(ProtobufDevice.newBuilder(getProtobufDevice(0)).setUserUuid(updatedUserUuid).build()),
        BsonDeviceFixture.getDocuments(10).stream()
          .peek(bson -> {
            if (bson.get(DeviceBsonKeys.J_USER_UUID).equals(getUserUUID(0))) {
              bson.put(DeviceBsonKeys.J_USER_UUID, "something else"); // Fails because the UUID won't be "something else"
            }
          })
          .collect(Collectors.toList())
      }

causes the test to fail as expected.

@davydkov
Copy link

davydkov commented Apr 20, 2018

Just caught the same NullPointerException.

java.lang.NullPointerException
                     	at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.AntJunitXmlReportListener.testStarted(AntJunitXmlReportListener.java:381)
                     	at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
                     	at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
                     	at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
                     	at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
                     	at org.scalatest.junit.RunNotifierReporter.apply(RunNotifierReporter.scala:61)
                     	at org.scalatest.WrapperCatchReporter.doApply(CatchReporter.scala:70)
                     	at org.scalatest.CatchReporter.apply(CatchReporter.scala:36)

pants_version: 1.5.0

I've narrowed down files to reproduce this issue
https://gist.github.com/davydkov/173f0348150d28ad22e9c8ed12b82378

@Eric-Arellano
Copy link
Contributor

I don't think this is relevant anymore. Closing.

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

5 participants