Skip to content

Flaky-test: PulsarFunctionsJavaThreadTest.testJavaLoggingFunction #15392

Description

@lhotari

PulsarFunctionsJavaThreadTest.testJavaLoggingFunction is flaky. It fails sporadically.

example failure

2022-04-29T10:26:05.4063041Z [ERROR] testJavaLoggingFunction(org.apache.pulsar.tests.integration.functions.java.PulsarFunctionsJavaThreadTest)  Time elapsed: 50.242 s  <<< FAILURE!
2022-04-29T10:26:05.4064216Z java.lang.NullPointerException: Cannot invoke "org.apache.pulsar.client.api.Message.getValue()" because "msg" is null
2022-04-29T10:26:05.4131524Z 	at org.apache.pulsar.tests.integration.functions.PulsarFunctionsTest.publishAndConsumeMessages(PulsarFunctionsTest.java:1583)
2022-04-29T10:26:05.4132844Z 	at org.apache.pulsar.tests.integration.functions.PulsarFunctionsTest.testLoggingFunction(PulsarFunctionsTest.java:1506)
2022-04-29T10:26:05.4133941Z 	at org.apache.pulsar.tests.integration.functions.java.PulsarFunctionsJavaTest.testJavaLoggingFunction(PulsarFunctionsJavaTest.java:111)
2022-04-29T10:26:05.4135136Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-04-29T10:26:05.4135817Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2022-04-29T10:26:05.4136564Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-04-29T10:26:05.4137167Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2022-04-29T10:26:05.4137752Z 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
2022-04-29T10:26:05.4138406Z 	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:45)
2022-04-29T10:26:05.4139003Z 	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:73)
2022-04-29T10:26:05.4139577Z 	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
2022-04-29T10:26:05.4140122Z 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2022-04-29T10:26:05.4140702Z 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
2022-04-29T10:26:05.4141652Z 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
2022-04-29T10:26:05.4142141Z 	at java.base/java.lang.Thread.run(Thread.java:833)

Activity

  1. shibd commented on Apr 29, 2022

    @shibd
    Member

    Please assign to me. Thanks.

  2. lhotari commented on Apr 29, 2022

    @lhotari
    MemberAuthor

    @shibd I would recommend investigating this with a "Personal CI" where you work on a fix in your own fork before create a PR. You can open PRs to your own fork of apache/pulsar to run GitHub Actions workflows in your own fork.

    There are some instructions in https://lists.apache.org/thread/1ofdbd9j1hhj4c0rw3o7vv8y6rbsxrp0 about using "Personal CI".

    The additional benefit of the "Personal CI" is that you get ssh access to the build VMs when the build is running. That is handled by this logic in the pulsar-ci.yaml GitHub Actions workflow file:

    - name: Setup ssh access to build runner VM
    # ssh access is enabled for builds in own forks
    if: ${{ github.repository != 'apache/pulsar' && needs.changed_files_job.outputs.docs_only != 'true' }}
    uses: ./.github/actions/ssh-access
    with:
    limit-access-to-actor: true

    and inline composite action implementation: https://github.com/apache/pulsar/blob/master/.github/actions/ssh-access/action.yml

    The ssh access is secured with the ssh key registered in Github. for example, your public keys are https://github.com/shibd.keys . That's the key that will have access to ssh when you run builds in your own fork.

  3. changed the title [-]Flaky-test: PulsarFunctionsTest.publishAndConsumeMessages[/-] [+]Flaky-test: PulsarFunctionsJavaThreadTest.testJavaLoggingFunction[/+] on Apr 29, 2022
  4. removed their assignment
    on May 4, 2022
  5. shibd commented on May 4, 2022

    @shibd
    Member

    I did not reproduce the problem locally env. I suspect that it is caused by the relatively small resource constraints in the CI environment. I unassigned this issue first.

  6. lhotari commented on Jun 2, 2022

    @lhotari
    MemberAuthor

    This is currently the most flaky test in our CI. There were 32 failues in the last 7 days. Detailed report

  7. github-actions commented on Jul 7, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  8. shibd commented on Jul 27, 2022

    @shibd
    Member

    After #16773, When the message is null, will print input and output stats.

    This ci: https://github.com/apache/pulsar/runs/7528475589?check_suite_focus=true

    It looks like the output message count is only 1.

    2022-07-26T20:53:35,218 - INFO  - [TestNG-method=testJavaLoggingFunction-1:PulsarFunctionsTest@1593] - Input topic stats: {
        "msgRateIn" : 0.0,
        "msgThroughputIn" : 0.0,
        "msgRateOut" : 0.0,
        "msgThroughputOut" : 0.0,
        "bytesInCounter" : 930,
        "msgInCounter" : 10,
        "bytesOutCounter" : 930,
        "msgOutCounter" : 10,
        "averageMsgSize" : 0.0,
        "msgChunkPublished" : false,
        "storageSize" : 930,
        "backlogSize" : 0,
        "publishRateLimitedTimes" : 0,
        "earliestMsgPublishTimeInBacklogs" : 0,
        "offloadedStorageSize" : 0,
        "lastOffloadLedgerId" : 0,
        "lastOffloadSuccessTimeStamp" : 0,
        "lastOffloadFailureTimeStamp" : 0,
        "publishers" : [ {
          "accessMode" : "Shared",
          "msgRateIn" : 0.0,
          "msgThroughputIn" : 0.0,
          "averageMsgSize" : 0.0,
          "chunkedMessageRate" : 0.0,
          "producerId" : 0,
          "supportsPartialProducer" : false,
          "metadata" : { },
          "address" : "/172.20.0.8:35192",
          "connectedSince" : "2022-07-26T20:53:04.916927853Z",
          "producerName" : "PulsarFunctionsJavaThreadTest-lqtmr-1-1"
        } ],
        "waitingPublishers" : 0,
        "subscriptions" : {
          "public/default/test-logging-fn-zjcurfae" : {
            "msgRateOut" : 0.0,
            "msgThroughputOut" : 0.0,
            "bytesOutCounter" : 930,
            "msgOutCounter" : 10,
            "msgRateRedeliver" : 0.0,
            "messageAckRate" : 0.0,
            "chunkedMessageRate" : 0,
            "msgBacklog" : 0,
            "backlogSize" : 0,
            "earliestMsgPublishTimeInBacklog" : 0,
            "msgBacklogNoDelayed" : 0,
            "blockedSubscriptionOnUnackedMsgs" : false,
            "msgDelayed" : 0,
            "unackedMessages" : 0,
            "type" : "Shared",
            "msgRateExpired" : 0.0,
            "totalMsgExpired" : 0,
            "lastExpireTimestamp" : 0,
            "lastConsumedFlowTimestamp" : 1658868775550,
            "lastConsumedTimestamp" : 1658868785068,
            "lastAckedTimestamp" : 1658868785077,
            "lastMarkDeleteAdvancedTimestamp" : 1658868785081,
            "consumers" : [ {
              "msgRateOut" : 0.0,
              "msgThroughputOut" : 0.0,
              "bytesOutCounter" : 930,
              "msgOutCounter" : 10,
              "msgRateRedeliver" : 0.0,
              "messageAckRate" : 0.0,
              "chunkedMessageRate" : 0.0,
              "consumerName" : "03bcf",
              "availablePermits" : 990,
              "unackedMessages" : 0,
              "avgMessagesPerEntry" : 1,
              "blockedConsumerOnUnackedMsgs" : false,
              "lastAckedTimestamp" : 1658868785077,
              "lastConsumedTimestamp" : 1658868785068,
              "metadata" : {
                "instance_id" : "0",
                "application" : "pulsar-function",
                "instance_hostname" : "pulsar-functions-worker-thread-smlge-1",
                "id" : "public/default/test-logging-fn-zjcurfae"
              },
              "address" : "/172.20.0.10:34762",
              "connectedSince" : "2022-07-26T20:52:55.547270947Z",
              "clientVersion" : "2.11.0-SNAPSHOT"
            } ],
            "isDurable" : true,
            "isReplicated" : false,
            "allowOutOfOrderDelivery" : false,
            "consumersAfterMarkDeletePosition" : { },
            "nonContiguousDeletedMessagesRanges" : 0,
            "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
            "subscriptionProperties" : { },
            "durable" : true,
            "replicated" : false
          }
        },
        "replication" : { },
        "deduplicationStatus" : "Disabled",
        "nonContiguousDeletedMessagesRanges" : 0,
        "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
        "compaction" : {
          "lastCompactionRemovedEventCount" : 0,
          "lastCompactionSucceedTimestamp" : 0,
          "lastCompactionFailedTimestamp" : 0,
          "lastCompactionDurationTimeInMills" : 0
        }
      }
      2022-07-26T20:53:35,262 - INFO  - [TestNG-method=testJavaLoggingFunction-1:PulsarFunctionsTest@1595] - Output topic stats: {
        "msgRateIn" : 0.0,
        "msgThroughputIn" : 0.0,
        "msgRateOut" : 0.0,
        "msgThroughputOut" : 0.0,
        "bytesInCounter" : 250,
        "msgInCounter" : 9,
        "bytesOutCounter" : 250,
        "msgOutCounter" : 9,
        "averageMsgSize" : 0.0,
        "msgChunkPublished" : false,
        "storageSize" : 250,
        "backlogSize" : 250,
        "publishRateLimitedTimes" : 0,
        "earliestMsgPublishTimeInBacklogs" : 0,
        "offloadedStorageSize" : 0,
        "lastOffloadLedgerId" : 0,
        "lastOffloadSuccessTimeStamp" : 0,
        "lastOffloadFailureTimeStamp" : 0,
        "publishers" : [ {
          "accessMode" : "Shared",
          "msgRateIn" : 0.0,
          "msgThroughputIn" : 0.0,
          "averageMsgSize" : 0.0,
          "chunkedMessageRate" : 0.0,
          "producerId" : 0,
          "supportsPartialProducer" : false,
          "metadata" : {
            "function" : "public/default/test-logging-fn-zjcurfae"
          },
          "address" : "/172.20.0.10:34762",
          "connectedSince" : "2022-07-26T20:52:55.626952108Z",
          "clientVersion" : "2.11.0-SNAPSHOT",
          "producerName" : "PulsarFunctionsJavaThreadTest-lqtmr-1-0"
        } ],
        "waitingPublishers" : 0,
        "subscriptions" : {
          "test-sub" : {
            "msgRateOut" : 0.0,
            "msgThroughputOut" : 0.0,
            "bytesOutCounter" : 250,
            "msgOutCounter" : 9,
            "msgRateRedeliver" : 0.0,
            "messageAckRate" : 0.0,
            "chunkedMessageRate" : 0,
            "msgBacklog" : 1,
            "backlogSize" : 0,
            "earliestMsgPublishTimeInBacklog" : 0,
            "msgBacklogNoDelayed" : 1,
            "blockedSubscriptionOnUnackedMsgs" : false,
            "msgDelayed" : 0,
            "unackedMessages" : 0,
            "type" : "Exclusive",
            "activeConsumerName" : "56376",
            "msgRateExpired" : 0.0,
            "totalMsgExpired" : 0,
            "lastExpireTimestamp" : 0,
            "lastConsumedFlowTimestamp" : 1658868784887,
            "lastConsumedTimestamp" : 1658868785128,
            "lastAckedTimestamp" : 0,
            "lastMarkDeleteAdvancedTimestamp" : 0,
            "consumers" : [ {
              "msgRateOut" : 0.0,
              "msgThroughputOut" : 0.0,
              "bytesOutCounter" : 250,
              "msgOutCounter" : 9,
              "msgRateRedeliver" : 0.0,
              "messageAckRate" : 0.0,
              "chunkedMessageRate" : 0.0,
              "consumerName" : "56376",
              "availablePermits" : 991,
              "unackedMessages" : 0,
              "avgMessagesPerEntry" : 9,
              "blockedConsumerOnUnackedMsgs" : false,
              "lastAckedTimestamp" : 0,
              "lastConsumedTimestamp" : 1658868785128,
              "metadata" : { },
              "address" : "/172.20.0.8:35192",
              "connectedSince" : "2022-07-26T20:53:04.880077815Z"
            } ],
            "isDurable" : true,
            "isReplicated" : false,
            "allowOutOfOrderDelivery" : false,
            "consumersAfterMarkDeletePosition" : { },
            "nonContiguousDeletedMessagesRanges" : 0,
            "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
            "subscriptionProperties" : { },
            "durable" : true,
            "replicated" : false
          }
        },
        "replication" : { },
        "deduplicationStatus" : "Disabled",
        "nonContiguousDeletedMessagesRanges" : 0,
        "nonContiguousDeletedMessagesRangesSerializedSize" : 0,
        "compaction" : {
          "lastCompactionRemovedEventCount" : 0,
          "lastCompactionSucceedTimestamp" : 0,
          "lastCompactionFailedTimestamp" : 0,
          "lastCompactionDurationTimeInMills" : 0
        }
      }
      2022-07-26T20:53:35,408 - INFO  - [TestNG-method=testJavaLoggingFunction-1:PulsarFunctionsTest@1597] - Input topic internal-stats: {
        "entriesAddedCounter" : 10,
        "numberOfEntries" : 10,
        "totalSize" : 930,
        "currentLedgerEntries" : 10,
        "currentLedgerSize" : 930,
        "lastLedgerCreatedTimestamp" : "2022-07-26T20:52:47.873Z",
        "waitingCursorsCount" : 1,
        "pendingAddEntriesCount" : 0,
        "lastConfirmedEntry" : "8:9",
        "state" : "LedgerOpened",
        "ledgers" : [ {
          "ledgerId" : 8,
          "entries" : 0,
          "size" : 0,
          "offloaded" : false,
          "metadata" : "LedgerMetadata{formatVersion=3, ensembleSize=2, writeQuorumSize=2, ackQuorumSize=2, state=CLOSED, length=930, lastEntryId=9, digestType=CRC32C, *** ensembles={0=[pulsar-bookie-0:3181, pulsar-bookie-1:3181]}, customMetadata={component=base64:bWFuYWdlZC1sZWRnZXI=, pulsar/managed-ledger=base64:cHVibGljL2RlZmF1bHQvcGVyc2lzdGVudC90ZXN0LWxvZy1KQVZBLWlucHV0LWZ1dGNidHRn, application=base64:cHVsc2Fy}}",
          "underReplicated" : false
        } ],
        "cursors" : {
          "public%2Fdefault%2Ftest-logging-fn-zjcurfae" : {
            "markDeletePosition" : "8:9",
            "readPosition" : "8:10",
            "waitingReadOp" : true,
            "pendingReadOps" : 0,
            "messagesConsumedCounter" : 10,
            "cursorLedger" : 15,
            "cursorLedgerLastEntry" : 1,
            "individuallyDeletedMessages" : "[]",
            "lastLedgerSwitchTimestamp" : "2022-07-26T20:52:54.578Z",
            "state" : "Open",
            "numberOfEntriesSinceFirstNotAckedMessage" : 1,
            "totalNonContiguousDeletedMessagesRange" : 0,
            "subscriptionHavePendingRead" : true,
            "subscriptionHavePendingReplayRead" : false,
            "properties" : { }
          }
        },
        "schemaLedgers" : [ {
          "ledgerId" : 14,
          "entries" : 1,
          "size" : 124,
          "offloaded" : false,
          "underReplicated" : false
        } ],
        "compactedLedger" : {
          "ledgerId" : -1,
          "entries" : -1,
          "size" : -1,
          "offloaded" : false,
          "metadata" : "LedgerMetadata{formatVersion=3, ensembleSize=2, writeQuorumSize=2, ackQuorumSize=2, state=CLOSED, length=124, lastEntryId=0, digestType=CRC32C, *** ensembles={0=[pulsar-bookie-0:3181, pulsar-bookie-1:3181]}, customMetadata={component=base64:c2NoZW1h, application=base64:cHVsc2Fy, pulsar/schemaId=base64:cHVibGljL2RlZmF1bHQvdGVzdC1sb2ctSkFWQS1pbnB1dC1mdXRjYnR0Zw==}}",
          "underReplicated" : false
        }
      }
      2022-07-26T20:53:35,489 - INFO  - [TestNG-method=testJavaLoggingFunction-1:PulsarFunctionsTest@1599] - Output topic internal-stats: {
        "entriesAddedCounter" : 1,
        "numberOfEntries" : 1,
        "totalSize" : 250,
        "currentLedgerEntries" : 1,
        "currentLedgerSize" : 250,
        "lastLedgerCreatedTimestamp" : "2022-07-26T20:52:48.142Z",
        "waitingCursorsCount" : 1,
        "pendingAddEntriesCount" : 0,
        "lastConfirmedEntry" : "11:0",
        "state" : "LedgerOpened",
        "ledgers" : [ {
          "ledgerId" : 11,
          "entries" : 0,
          "size" : 0,
          "offloaded" : false,
          "metadata" : "LedgerMetadata{formatVersion=3, ensembleSize=2, writeQuorumSize=2, ackQuorumSize=2, state=CLOSED, length=250, lastEntryId=0, digestType=CRC32C, *** ensembles={0=[pulsar-bookie-1:3181, pulsar-bookie-0:3181]}, customMetadata={component=base64:bWFuYWdlZC1sZWRnZXI=, pulsar/managed-ledger=base64:cHVibGljL2RlZmF1bHQvcGVyc2lzdGVudC90ZXN0LWxvZy1KQVZBLWxvZy10b3BpYy1vcXh1Z3dvcg==, application=base64:cHVsc2Fy}}",
          "underReplicated" : false
        } ],
        "cursors" : {
          "test-sub" : {
            "markDeletePosition" : "11:-1",
            "readPosition" : "11:1",
            "waitingReadOp" : true,
            "pendingReadOps" : 0,
            "messagesConsumedCounter" : 0,
            "cursorLedger" : -1,
            "cursorLedgerLastEntry" : -1,
            "individuallyDeletedMessages" : "[]",
            "lastLedgerSwitchTimestamp" : "2022-07-26T20:53:04.873Z",
            "state" : "NoLedger",
            "numberOfEntriesSinceFirstNotAckedMessage" : 2,
            "totalNonContiguousDeletedMessagesRange" : 0,
            "subscriptionHavePendingRead" : true,
            "subscriptionHavePendingReplayRead" : false,
            "properties" : { }
          }
        },
        "schemaLedgers" : [ ],
        "compactedLedger" : {
          "ledgerId" : -1,
          "entries" : -1,
          "size" : -1,
          "offloaded" : false,
          "underReplicated" : false
        }
      }
    
  9. assigned and unassigned on Jul 28, 2022
  10. github-actions commented on Aug 28, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  11. lhotari commented on Aug 29, 2022

    @lhotari
    MemberAuthor

    this remains very flaky

      Error:  Tests run: 59, Failures: 1, Errors: 0, Skipped: 45, Time elapsed: 1,035.55 s <<< FAILURE! - in TestSuite
      Error:  testJavaLoggingFunction(org.apache.pulsar.tests.integration.functions.java.PulsarFunctionsJavaThreadTest)  Time elapsed: 178.075 s  <<< FAILURE!
      java.lang.AssertionError: expected [10] but found [0]
      	at org.testng.Assert.fail(Assert.java:99)
      	at org.testng.Assert.failNotEquals(Assert.java:1037)
      	at org.testng.Assert.assertEqualsImpl(Assert.java:140)
      	at org.testng.Assert.assertEquals(Assert.java:122)
      	at org.testng.Assert.assertEquals(Assert.java:797)
      	at org.testng.Assert.assertEquals(Assert.java:807)
      	at org.apache.pulsar.tests.integration.functions.PulsarFunctionsTest.getFunctionStats(PulsarFunctionsTest.java:1013)
      	at org.apache.pulsar.tests.integration.functions.PulsarFunctionsTest.testLoggingFunction(PulsarFunctionsTest.java:1521)
      	at org.apache.pulsar.tests.integration.functions.java.PulsarFunctionsJavaTest.testJavaLoggingFunction(PulsarFunctionsJavaTest.java:111)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
      	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:45)
      	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:73)
      	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      	at java.base/java.lang.Thread.run(Thread.java:833)
    

    at https://github.com/apache/pulsar/runs/8066475125?check_suite_focus=true#step:11:19252

  12. added a commit that references this issue on Sep 5, 2022
    f7e01b9
  13. added a commit that references this issue on Sep 6, 2022
    2a07cb4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions