testkube icon indicating copy to clipboard operation
testkube copied to clipboard

Getting error while running test with huge response

Open nizamkhazi87 opened this issue 2 years ago • 3 comments

Hi Testkube Team ,

We are executing test and getting below error .

Error : ⨯ invalid character 'c' looking for beginning of value

How can we fix this issue and my api response is 2.7MB and text response .

Sample Response : (window.webpackJsonp=window.webpackJsonp||[]).push([ [ 1 ], [function(e,t,n){ "use strict";e.exports=n(783) },function(e,t,n){ "use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t ];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r ]=n[r ]) }return e }).apply(this,arguments) }n.d(t, "a",(function(){return r })) },function(e,t,n){ "use strict";n.d(t, "a",(function(){return d })),n.d(t, "c",(function(){return g })),n.d(t, "d",(function(){return x })),n.d(t, "b",(function(){return h }));var r=n(0),i=n.n(r),o=i.a.createContext(null);var a=function(e){e() };function s(){var e=a,t=null,n=null;return{clear:function(){t=null,n=null },notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next })) },get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e },subscribe:function(e){var r=!0,i=n={callback:e,next: null,prev:n };return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next) } } } }var u={notify:function(){},get:function(){return[] } };function l(e,t){var n,r=u;function i(){a.onStateChange&&a.onStateChange() }function o(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=s()) }var a={addNestedSub:function(e){return o(),r.subscribe(e) },notifyNestedSubs:function(){r.notify() },handleChangeWrapper:i,isSubscribed:function(){return Boolean(n) },trySubscribe:o,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=u) },getListeners:function(){return r } };return a }var c="undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?r.useLayoutEffect:r.useEffect;var d=function(e){var t=e.store,n=e.context,a=e.children,s=Object(r.useMemo)((function(){var e=l(t);return e.onStateChange=e.notifyNestedSubs, {store:t,subscription:e } }), [t ]),u=Object(r.useMemo)((function(){return t.getState() }), [t ]);c((function(){var e=s.subscription;return e.trySubscribe(),u!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null } }), [s,u ]);var d=n||o;return i.a.createElement(d.Provider, {value:s },a) };n(1),n(13),n(71),n(705);function f(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t }function h(e,t){if(f(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i ])||!f(e[n[i ] ],t[n[i ] ]))return!1;return!0 }function p(){return Object(r.useContext)(o) }function m(e){void 0===e&&(e=o);var t=e===o?p:function(){return Object(r.useContext)(e) };return function(){return t().store } }var v=m();function b(e){void 0===e&&(e=o);var t=e===o?v:m(e);return function(){return t().dispatch } }var g=b(),y=function(e,t){return e===t };function (e){void 0===e&&(e=o);var t=e===o?p:function(){return Object(r.useContext)(e) };return function(e,n){void 0===n&&(n=y);var i=t(),o=function(e,t,n,i){var o,a=Object(r.useReducer)((function(e){return e+1 }), 0)[ 1 ],s=Object(r.useMemo)((function(){return l(n,i) }), [n,i ]),u=Object(r.useRef)(),d=Object(r.useRef)(),f=Object(r.useRef)(),h=Object(r.useRef)(),p=n.getState();try{if(e!==d.current||p!==f.current||u.current){var m=e(p);o=void 0!==h.current&&t(m,h.current)?h.current:m }else o=h.current }catch(v){throw u.current&&(v.message+="\nThe error may be correlated with this previous error:\n"+u.current.stack+"\n\n"),v }return c((function(){d.current=e,f.current=p,h.current=o,u.current=void 0 })),c((function(){function e(){try{var e=n.getState();if(e===f.current)return;var r=d.current(e);if(t(r,h.current))return;h.current=r,f.current=e }catch(v){u.current=v }a() }return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe() } }), [n,s ]),o }(e,n,i.store,i.subscription);return Object(r.useDebugValue)(o),o } }var w,x=(),M=n(34);w=M.unstable_batchedUpdates,a=w },

Attaching Test script for refrence. TEST.txt

nizamkhazi87 avatar Sep 29 '22 08:09 nizamkhazi87

hey, @nizamkhazi87

Have you tired our latest 1.5.39 release? We improved processing of large strings for test output. We print all output as json based strings. Sounds like, we got error when we are parsing them back for cli. Ideally, we will need to reproduce this bug on our side

vsukhin avatar Sep 29 '22 11:09 vsukhin

might be, @tkonieczny could see something similar?

vsukhin avatar Sep 29 '22 11:09 vsukhin

Reproduced it using the maven-executor:

testkube create test --git-uri https://github.com/kubeshop/testkube-executor-maven.git --git-path examples/hello-maven-settings --type maven/test --name maven-example-test --git-branch main

testkube run test maven-example-test --copy-files "/Users/lilla/kubeshop/src/testkube-executor-maven/examples/hello-maven-settings/settings.xml:/tmp/settings.xml" --args "--settings" --args "/tmp/settings.xml" -v "TESTKUBE_MAVEN=true"

image

Versions: CLIENT VERSION | SERVER VERSION | CLUSTER VERSION
-----------------+----------------+------------------ 1.5.41 | v1.5.41 | v1.23.4

vLia avatar Sep 30 '22 14:09 vLia

Sound like, it's an issue for watch execution, get execution works fine

vsukhin avatar Oct 06 '22 12:10 vsukhin

Fixed

nicufk avatar Oct 19 '22 08:10 nicufk