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

Live Instrument integration testing #515

Closed
12 of 14 tasks
BFergerson opened this issue Aug 7, 2022 · 4 comments
Closed
12 of 14 tasks

Live Instrument integration testing #515

BFergerson opened this issue Aug 7, 2022 · 4 comments

Comments

@BFergerson
Copy link
Member

BFergerson commented Aug 7, 2022

@abdlquadri, take a look at https://github.com/sourceplusplus/live-platform/blob/master/platform/processor/live-instrument/src/test/kotlin/integration/SimplePrimitivesLiveInstrumentTest.kt for the new live instrument integration test structure.

This is a self-contained test that adds a live breakpoint to itself and verifies data types and values. It uses dynamic line numbers through the use of addLineLabel(labelName). This allows you to build tests without having to worry about line numbers changing and supports adding multiple line number labels for more complex tests.

I'll add more tests as I think of them but to get started please add tests verifying:

Live Breakpoint

  • Arrays and lists of each primitive type works
  • Datatypes defined in LiveVariablePresentation are formatted correctly
  • Multiple breakpoints can be placed one line number apart
  • Multiple breakpoints can be placed on the same line number
  • Large objects get rejected (search this repo for TWO_MB_ARR for an example of a large object)
  • Deep objects get rejected (e.x. an object that contains an object four layers deep)
  • Verify throttle works (LiveBreakpoint.throttle)
  • Verify meta propagates (LiveBreakpoint.meta)
  • Verify hit limit works (LiveBreakpoint.hitLimit)
  • Verify expires at works (LiveBreakpoint.expiresAt)
  • Verify condition works (LiveBreakpoint.condition)

Live Log

  • Ensure primitive types format correctly

Live Meter

  • todo

Live Span

  • todo

If you need me to clarify anything, please let me know.

@BFergerson
Copy link
Member Author

BFergerson commented Aug 7, 2022

@abdlquadri, I implemented the first task to give you more examples of how these tests should be designed. I also show how you should handle when the data returned looks invalid (i.e. comment it out and describe what's failing).

You can see how I solved the first task here: 29b9710

@abdlquadri
Copy link
Contributor

@BFergerson Thanks for these pointers.

@BFergerson BFergerson changed the title [Test] Live Instrument integration testing Live Instrument integration testing Aug 8, 2022
@abdlquadri
Copy link
Contributor

@BFergerson I was working the composite data types tests and noticed a test failure with No handlers for address spp.service.live-instrument

I switched to master to confirm, noticed the same result:

./gradlew -p platform/processor/live-instrument test -Dtest.profile=integration

They fail with:

   (NO_HANDLERS,-1) No handlers for address spp.service.live-instrument
       at app//io.vertx.core.eventbus.impl.EventBusImpl.deliverMessageLocally(EventBusImpl.java:384)
       at app//io.vertx.core.eventbus.impl.EventBusImpl.sendLocally(EventBusImpl.java:341)
       at app//io.vertx.core.eventbus.impl.EventBusImpl.sendOrPub(EventBusImpl.java:329)
       at app//io.vertx.core.eventbus.impl.clustered.ClusteredEventBus.sendToNode(ClusteredEventBus.java:309)
       at app//io.vertx.core.eventbus.impl.clustered.ClusteredEventBus.lambda$sendOrPub$4(ClusteredEventBus.java:181)
       at app//io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
       at app//io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
       at app//io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
       at app//io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
       at app//io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49)
       at app//io.vertx.core.impl.future.FutureImpl$ListenerArray.onSuccess(FutureImpl.java:262)
       at app//io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
       at app//io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
       at app//io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
       at app//io.vertx.core.spi.cluster.impl.DefaultNodeSelector.lambda$selectForSend$0(DefaultNodeSelector.java:43)
       at app//io.vertx.core.spi.cluster.impl.selector.Selectors.lambda$withSelector$1(Selectors.java:49)
       at app//io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
       at app//io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
       at app//io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
       at app//io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
       at app//io.vertx.core.Promise.complete(Promise.java:66)
       at app//io.vertx.core.spi.cluster.impl.selector.Selectors.dataReceived(Selectors.java:85)
       at app//io.vertx.core.spi.cluster.impl.selector.Selectors.lambda$initialize$2(Selectors.java:64)
       at app//io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
       at app//io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
       at app//io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
       at app//io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
       at app//io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49)
       at app//io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54)
       at app//io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
       at app//io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
       at app//io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
       at app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
       at app//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
       at app//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
       at app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
       at java.base@11.0.2/java.lang.Thread.run(Thread.java:834)

1 test completed, 1 failed

Could you please confirm this behavior on your end?
Are there steps I need to take before running the tests?

@BFergerson
Copy link
Member Author

BFergerson commented Aug 10, 2022

You likely need to wait ~30 seconds before running tests. You can use this to check if the platform is fully started:

curl -k --request GET \
  --url https://localhost/health \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJkZXZlbG9wZXJfaWQiOiJzeXN0ZW0iLCJjcmVhdGVkX2F0IjoxNjU5NzA0NTkwNzY5LCJleHBpcmVzX2F0IjoxNjkxMjQwNTkwNzcwLCJpYXQiOjE2NTk3MDQ1OTB9.ISeT9ygqOvjSgH7ydwDEKLfkxfSMDhopAl0qMpkqMJ9LldHHozWVVD4J9kZzCXJHa105bQ2m8Yt2XMvrv1_rI74XzSCBnrE3ThCHsHw-q9vDwArjxfl7laDpA1ndASpRWxxMMC0O-Ofl8b5cdpqpXsysACG-A7Z0SlJbidOajJQk2pRxhn5dxJ_zifjLRTEH9QishD9IDeU1OOF2KiuycNFoiRtJXuMIgWoqsRcC__8cAU5CyjQieCpltiuiZ_iYLf9l65PvjnANfN8R2zkZvYUEDEWoMOJcWTv6IuSdwJvMQeRxflVlUU1ZWN4-RTTGcaQxzw4j53fIZZjGplVeCQiHS_V5nw99pNl2idJyJZvQiDN0iNbcRCLaETZHQCIlu19qgAszfP9HesQf6xPMHJnhglMbP5Tmo1lst3i65f2yJbybH6uPxLfJGIo3XisFAVeHQgY0D34eM4ElcYyHPLk16DvJczmtkuEPxGPlwzBRLoWXv8GOC4T0kfGEctCB9ZbgLM0s-KwpH4AB9bBlt4EgLY3UzNxatF8FV8Q9TJMPXnFpkuO0Ai_VxhIxd5eQ-a56OmvjXOHKY_0zO5XvkNOd0MsWXdVmjlHbgH15bpQmKNoKCvc_wcc4wWbqG1Llad10-gSh0Sf2jsWVQ3ZoHjDaa7qoHFPpNn3tQej5XKY'

You could also just check the platform logs and wait for:

2022-08-10 05:49:28,496 - spp.processor.live.impl.LiveInstrumentProcessorImpl -15069 [vert.x-eventloop-thread-0] INFO  [] - Starting LiveInstrumentProcessorImpl
2022-08-10T05:49:28.504019686Z 2022-08-10 05:49:28,503 - spp.processor.InstrumentProcessor -15076 [vert.x-eventloop-thread-14] INFO  [] - Live instrument processor published
2022-08-10T05:49:28.504503831Z 2022-08-10 05:49:28,504 - spp.platform.core.SourcePlatform -15077 [vert.x-eventloop-thread-1] DEBUG [] - Service UP: spp.service.live-instrument

Specifically: Service UP: spp.service.live-instrument

BFergerson added a commit that referenced this issue Aug 14, 2022
BFergerson added a commit that referenced this issue Aug 14, 2022
* feat: show why variables are skipped in plugin

ref: #484

* test: deep object and large object

ref: #515
@BFergerson BFergerson assigned BFergerson and unassigned abdlquadri Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants