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

Bedrock streaming integration testing #14

Merged
merged 9 commits into from
Nov 15, 2023

Conversation

stephmilovic
Copy link
Owner

WIP


passThrough.on('data', (chunk) => {
// logs the state of the stream, but not the stream itself
console.log('passThrough.data???', chunk.toString());
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only returns the state of the stream, not the stream itself

passThrough.data??? {
   "status":"ok",
   "data":{
      "_readableState":{
         "objectMode":false,
         "highWaterMark":16384,
         "buffer":{
            "head":null,
            "tail":null,
            "length":0
         },
         "length":0,
         "pipes":[
            {
               "_readableState":{
                  "objectMode":false,
                  "highWaterMark":16384,
                  "buffer":{
                     "head":null,
                     "tail":null,
                     "length":0
                  },
                  "length":0,
                  "pipes":[
                     
                  ],
                  "flowing":true,
                  "ended":false,
                  "endEmitted":false,
                  "reading":false,
                  "constructed":true,
                  "sync":false,
                  "needReadable":false,
                  "emittedReadable":false,
                  "readableListening":false,
                  "resumeScheduled":true,
                  "errorEmitted":false,
                  "emitClose":true,
                  "autoDestroy":true,
                  "destroyed":false,
                  "errored":null,
                  "closed":false,
                  "closeEmitted":false,
                  "defaultEncoding":"utf8",
                  "awaitDrainWriters":null,
                  "multiAwaitDrain":false,
                  "readingMore":false,
                  "dataEmitted":false,
                  "decoder":null,
                  "encoding":null
               },
               "_events":{
                  "error":[
                     null,
                     null
                  ],
                  "close":[
                     null,
                     null
                  ],
                  "finish":[
                     null,
                     null
                  ]
               },
               "_eventsCount":7,
               "_writableState":{
                  "objectMode":false,
                  "highWaterMark":16384,
                  "finalCalled":false,
                  "needDrain":false,
                  "ending":false,
                  "ended":false,
                  "finished":false,
                  "destroyed":false,
                  "decodeStrings":true,
                  "defaultEncoding":"utf8",
                  "length":0,
                  "writing":false,
                  "corked":0,
                  "sync":true,
                  "bufferProcessing":false,
                  "writecb":null,
                  "writelen":0,
                  "afterWriteTickInfo":null,
                  "buffered":[
                     
                  ],
                  "bufferedIndex":0,
                  "allBuffers":true,
                  "allNoop":true,
                  "pendingcb":0,
                  "constructed":true,
                  "prefinished":false,
                  "errorEmitted":false,
                  "emitClose":true,
                  "autoDestroy":true,
                  "errored":null,
                  "closed":false,
                  "closeEmitted":false
               },
               "allowHalfOpen":true
            }
         ],
         "flowing":true,
         "ended":false,
         "endEmitted":false,
         "reading":false,
         "constructed":true,
         "sync":false,
         "needReadable":false,
         "emittedReadable":false,
         "readableListening":false,
         "resumeScheduled":true,
         "errorEmitted":false,
         "emitClose":true,
         "autoDestroy":true,
         "destroyed":false,
         "errored":null,
         "closed":false,
         "closeEmitted":false,
         "defaultEncoding":"utf8",
         "awaitDrainWriters":null,
         "multiAwaitDrain":false,
         "readingMore":false,
         "dataEmitted":false,
         "decoder":null,
         "encoding":null
      },
      "_events":{
         
      },
      "_eventsCount":7,
      "_writableState":{
         "objectMode":false,
         "highWaterMark":16384,
         "finalCalled":false,
         "needDrain":false,
         "ending":false,
         "ended":false,
         "finished":false,
         "destroyed":false,
         "decodeStrings":true,
         "defaultEncoding":"utf8",
         "length":0,
         "writing":false,
         "corked":0,
         "sync":true,
         "bufferProcessing":false,
         "writecb":null,
         "writelen":0,
         "afterWriteTickInfo":null,
         "buffered":[
            
         ],
         "bufferedIndex":0,
         "allBuffers":true,
         "allNoop":true,
         "pendingcb":0,
         "constructed":true,
         "prefinished":false,
         "errorEmitted":false,
         "emitClose":true,
         "autoDestroy":true,
         "errored":null,
         "closed":false,
         "closeEmitted":false
      },
      "allowHalfOpen":true
   },
   "connector_id":"c76a64e3-7382-4f83-a525-703f3f0ad6d2"
}

This is what the response looks like logged in real life:

{
  status: 'ok',
  data: Transform {
    _readableState: ReadableState {
      objectMode: false,
      highWaterMark: 16384,
      buffer: BufferList { head: null, tail: null, length: 0 },
      length: 0,
      pipes: [Array],
      flowing: true,
      ended: false,
      endEmitted: false,
      reading: false,
      constructed: true,
      sync: false,
      needReadable: false,
      emittedReadable: false,
      readableListening: false,
      resumeScheduled: true,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      destroyed: false,
      errored: null,
      closed: false,
      closeEmitted: false,
      defaultEncoding: 'utf8',
      awaitDrainWriters: null,
      multiAwaitDrain: false,
      readingMore: false,
      dataEmitted: false,
      decoder: null,
      encoding: null,
      [Symbol(kPaused)]: false
    },
    _events: [Object: null prototype] {
      prefinish: [Function: prefinish],
      unpipe: [Function: onunpipe],
      error: [Function: onerror],
      close: [Function],
      finish: [Function],
      end: [Function],
      data: [Function: ondata]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    _writableState: WritableState {
      objectMode: false,
      highWaterMark: 16384,
      finalCalled: false,
      needDrain: false,
      ending: false,
      ended: false,
      finished: false,
      destroyed: false,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      length: 0,
      writing: false,
      corked: 0,
      sync: true,
      bufferProcessing: false,
      onwrite: [Function: bound onwrite],
      writecb: null,
      writelen: 0,
      afterWriteTickInfo: null,
      buffered: [],
      bufferedIndex: 0,
      allBuffers: true,
      allNoop: true,
      pendingcb: 0,
      constructed: true,
      prefinished: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      errored: null,
      closed: false,
      closeEmitted: false,
      [Symbol(kOnFinished)]: []
    },
    allowHalfOpen: true,
    _transform: [Function: transform],
    [Symbol(kCapture)]: false,
    [Symbol(kCallback)]: null
  },
  actionId: '337fc345-352e-459f-8c2c-817604ad14bd'
}

As you can see, on my real server, I get a Transform. On supertest, i get only the state of the Tranform

@stephmilovic stephmilovic merged commit b5e8e83 into bedrock_streaming Nov 15, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant