Firefox browser disconnect issue when running tests via testem - firefox

I am trying to run my ember tests in parallel using ember exam. However when I run the tests I am frequently getting browser disconnect issue, with following log:
[16:41:10][Step 6/6] not ok 561 Firefox - error
[16:41:10][Step 6/6] ---
[16:41:10][Step 6/6] message: >
[16:41:10][Step 6/6] Error: Browser disconnected
[16:41:10][Step 6/6] Stderr:
[16:41:10][Step 6/6] *** You are running in headless mode.
[16:41:10][Step 6/6] [Parent 12706, Gecko_IOThread] WARNING: pipe error (45): Connection reset by peer: file /build/firefox-8HKHfQ/firefox-57.0+build4/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353
[16:41:10][Step 6/6]
[16:41:10][Step 6/6] ###!!! [Parent][MessageChannel] Error: (msgtype=0x24001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv
[16:41:10][Step 6/6]
[16:41:10][Step 6/6]
[16:41:10][Step 6/6] ###!!! [Parent][MessageChannel] Error: (msgtype=0x150083,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv
[16:41:10][Step 6/6]
[16:41:10][Step 6/6]
[16:41:10][Step 6/6] ###!!! [Parent][MessageChannel] Error: (msgtype=0x150083,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv
[16:41:10][Step 6/6]
[16:41:10][Step 6/6]
[16:41:10][Step 6/6]
[16:41:10][Step 6/6] Log: |
[16:41:10][Step 6/6] { type: 'error', text: 'Error: Browser disconnected' }
[16:41:10][Step 6/6] { type: 'error',
[16:41:10][Step 6/6] text: '*** You are running in headless mode.\n[Parent 12706, Gecko_IOThread] WARNING: pipe error (45): Connection reset by peer: file /build/firefox-8HKHfQ/firefox-57.0+build4/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353\n\n###!!! [Parent][MessageChannel] Error: (msgtype=0x24001F,name=PContent::Msg_PreferenceUpdate) Channel error: cannot send/recv\n\n\n###!!! [Parent][MessageChannel] Error: (msgtype=0x150083,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv\n\n\n###!!! [Parent][MessageChannel] Error: (msgtype=0x150083,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv\n\n' }
[16:41:10][Step 6/6] ...
I am running firefox version 57, version 59 is better but even there I see this issue quite frequently, chrome however seems to fare well but on occasion it fails too. Initially I thought its because I am running in headless mode, but even in non-headless mode things do not get any better. And my testem.js file is:
let today = new Date();
const testWindowWidth = 1920;
const testWindowHeight = 1080;
/**
* Exports configuration to run tests via testem.
* There are issues with running the test in firefox in headless mode.
* Chrome however works fine with the provided configuration.
* #see : https://github.com/testem/testem/issues/1117
* */
module.exports = {
'framework': 'qunit',
'test_page': [
'tests/index.html?hidepassed&nojshint'
],
'disable_watching': true,
'parallel': -1,//sky is the limit
'launch_in_ci': [
'Firefox'
],
'launch_in_dev': [
'Chrome'
],
'browser_args': {
'Firefox': [
`-headless`,//comment this line out for debugging purpose
`-width ${testWindowWidth}`,
`-height ${testWindowHeight}`
],
'Chrome': [
'--headless',//comment this line out for debugging purpose
'--disable-gpu',
'--remote-debugging-port=9222',
'--remote-debugging-address=0.0.0.0',
'--no-sandbox',
'--user-data-dir=/tmp',
`--window-size=${testWindowWidth},${testWindowHeight}`
]
},
'browser_start_timeout': 2 * 60,
'report_file': `tests/logs/${today.getFullYear()}-${today.getMonth() + 1}-${today.getDate()}/${today}.txt`,
'browser_disconnect_timeout': 2 * 60
};
I don't know if the problem is with testem configuration or the browser itself! Your help/suggestions will be much appreciated, thanks.

I was not able to solve the issue but I was able to avoid the browser disconnect issue via ember-exam. The trick was to figure out the no of partitions to split out the tests and run just subset of it in parallel such that each ember run has about 200 tests top. We have fairly large ember application with upwards of 3k tests, so I ended up creating shell script to manage the split.
//run-tests.sh
const exec = require('child_process').exec;
var split = 100;//total no of partitions to split the tests into
var parallelRuns = 4;//total no of partitions to run in parallel at a time
var runTestModule = function(partitionNo) {
if (partitionNo > split) {
return;
}
var _partitions = [];
for (var i = 0; i < parallelRuns; i++) {
_partitions.push(++partitionNo);
}
var partitions = _partitions.map(function(index) {
return "--partition=" + index;
}).join(" ");
var command = "./node_modules/.bin/ember exam --path=./dist --split=" + split + " " + partitions + " --parallel";
console.log(
"\n===============================================RUNNING COMMAND===============================================================\n" +
command +
"\n=============================================================================================================================\n");
exec(command, function(e, stdout, stderr) {
if (e instanceof Error) {
console.error(e);
//throw e;
}
console.log('stdout ', stdout);
console.log('stderr ', stderr);
runTestModule(partitionNo);
});
};
runTestModule(0);

Related

Anchor,Solana -> failed to send transaction: Transaction simulation failed Custom Error 0x0

I am trying to build a simple coin flip game in solana.
Full code here
I get this error:
Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
I followed some tutorials on how to use PDA's but couldn't find a report/workaround to an error as such.
Tests are running on localhost
I did some research and it might be that the account was already initialized ( maybe, no idea)
the part that is giving the error:
try {
await program.rpc.initialize(bump,
{
accounts: {
treasury: treasuryPda, // publickey for our new account
user: provider.wallet.publicKey,
systemProgram: SystemProgram.programId // just for Anchor reference
},
});
} catch (error) {
console.log("Transaction error: ", error);
console.log("blabla:", error.toString());
}

GraphQL build error when deploying at Vercel

I'm trying to deploy my Nextjs app to Vercel, I am using strapi backend deployed at Heroku...
Unfortunately I am stuck at this build error at Vercel....
I have googled and tried to find a solution but unfortunately I can't and have no idea what to do.
Any ideas appreciated....
> Build error occurred
Error: Unexpected token M in JSON at position 0
at new ApolloError (/vercel/path0/node_modules/#apollo/client/errors/errors.cjs:34:28)
at /vercel/path0/node_modules/#apollo/client/core/core.cjs:1595:19
at both (/vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:986:53)
at /vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:979:72
at new Promise (<anonymous>)
at Object.then (/vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:979:24)
at Object.error (/vercel/path0/node_modules/#apollo/client/utilities/utilities.cjs:987:49)
at notifySubscription (/vercel/path0/node_modules/zen-observable/lib/Observable.js:140:18)
at onNotify (/vercel/path0/node_modules/zen-observable/lib/Observable.js:179:3)
at SubscriptionObserver.error (/vercel/path0/node_modules/zen-observable/lib/Observable.js:240:7) {
type: 'ApolloError',
graphQLErrors: [],
clientErrors: [],
networkError: {
name: 'ServerParseError',
response: { size: 0, timeout: 0 },
statusCode: 405,
bodyText: 'Method Not Allowed'
}
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1

Near Protocol FunctionCallError(MethodResolveError(MethodNotFound))

I'm new in blockchain, smart contract and near protocol. I'm trying to learn from https://near.academy/ . There's a sample contract on testnet : museum.testnet.
I'm using windows and i installed wsl2.
I can login with
near login command. But after that, when i called near view museum.testnet getmemecount command its giving me error below. Can anyone help me on this?
View call: museum.testnet.getmemecount()
An error occured
Error: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound)).
{
"block_hash": "SZv8UsCeNXLkhjPa9KeZY6xJXmKNb6MLyKXqHVddiT5",
"block_height": 65109663,
"error": "wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))",
"logs": []
}
at JsonRpcProvider.query (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:116:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Account.viewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:351:24)
at async exports.callViewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/index.js:75:48)
at async Object.handler (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9)
TypedError: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound)).
{
"block_hash": "SZv8UsCeNXLkhjPa9KeZY6xJXmKNb6MLyKXqHVddiT5",
"block_height": 65109663,
"error": "wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))",
"logs": []
}
at JsonRpcProvider.query (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:116:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Account.viewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:351:24)
at async exports.callViewFunction (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/index.js:75:48)
at async Object.handler (/home/cinar/.nvm/versions/node/v14.18.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
type: 'UntypedError',
context: undefined
}
The method name is get_meme_count, not getmemecount. See the source code of the museum here.
$ near view museum.testnet get_meme_count
View call: museum.testnet.get_meme_count()
67
Does some part of near academy mention it as getmemecount?

Error while running .navigateTo() protocol action: timeout

I updated the Nightwatch version to 1.0.19.
While Executing the script I have the following timeout issue in navigate() function.
here is the console output:
{ sessionId: '2aeb3cd9367d3580ae4ae705abca2a80',
status: 21,
value:
{ message: 'timeout',
error:
[ ' (Session info: chrome=63.0.3239.132)',
' (Driver info: chromedriver=2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881),platform=Linux 4.4.0-1038-aws x86_64)' ] } }
Error while running .navigateTo() protocol action: timeout
..........................

Protractor error selenium spring boot

vegan#vegan:~/hb-productupload/gateway/src/test/javascript$ gulp protractor
[15:47:24] Working directory changed to ~/hb-productupload/gateway
[15:47:51] Using gulpfile ~/hb-productupload/gateway/gulpfile.js
[15:47:51] Starting 'protractor'...
Using ChromeDriver directly...
[launcher] Running 1 instances of WebDriver
/home/vegan/hb-productupload/gateway/node_modules/selenium-webdriver/http/index.js:174
callback(new Error(message));
^
Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:47841
at ClientRequest.<anonymous> (/home/vegan/hb-productupload/gateway/node_modules/selenium-webdriver/http/index.js:174:16)
at emitOne (events.js:90:13)
at ClientRequest.emit (events.js:182:7)
at Socket.socketErrorListener (_http_client.js:306:9)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at emitErrorNT (net.js:1265:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/home/vegan/hb-productupload/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (/home/vegan/hb-productupload/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
at new Driver (/home/vegan/hb-productupload/gateway/node_modules/selenium-webdriver/chrome.js:810:36)
at [object Object].DirectDriverProvider.getNewDriver (/home/vegan/hb-productupload/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/driverProviders/direct.js:68:16)
at [object Object].Runner.createBrowser (/home/vegan/hb-productupload/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:186:37)
at /home/vegan/hb-productupload/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:276:21
at _fulfilled (/home/vegan/hb-productupload/gateway/node_modules/gulp-protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/home/vegan/hb-productupload/gateway/node_modules/gulp-protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/home/vegan/hb-productupload/gateway/node_modules/gulp-protractor/node_modules/q/q.js:759:13)
at /home/vegan/hb-productupload/gateway/node_modules/gulp-protractor/node_modules/q/q.js:525:49
[launcher] Process exited with error code 1
[15:47:59] gulp-notify: [JHipster Gulp Build] Error: protractor exited with code 1
[15:47:59] Finished 'protractor' after 7.34 s
[15:47:59] E2E Tests failed
I am trying to run a simple
i updated chrme driver.
Then i made
npm install
bower install
gulp install
but did not work when i run
gulp protractor
I run with gulp for project but also i downloaded to my ubuntu and i can run as local. But same error for that local happens when i run
protractor protractor.conf.js
Ysterday i could run both, i made upgrade. now i cant work both.
this is conf file
var HtmlScreenshotReporter = require("protractor-jasmine2-screenshot-reporter");
var JasmineReporters = require('jasmine-reporters');
var prefix = 'src/test/javascript/'.replace(/[^/]+/g, '..');
exports.config = {
chromeDriver: prefix + 'node_modules/protractor/selenium/chromedriver',
allScriptsTimeout: 20000,
suites: {
login: './e2e/account/login/*.js'
},
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
framework: 'jasmine2',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
},
onPrepare: function () {
// Disable animations so e2e tests run more quickly
var disableNgAnimate = function () {
angular
.module('disableNgAnimate', [])
.run(
[
'$animate',
function ($animate) {
$animate.enabled(false);
}
]
);
};
var disableCssAnimate = function () {
angular
.module('disableCssAnimate', [])
.run(
function () {
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = 'body * {' +
'-webkit-transition: none !important;' +
'-moz-transition: none !important;' +
'-o-transition: none !important;' +
'-ms-transition: none !important;' +
'transition: none !important;' +
'}';
document.getElementsByTagName('head')[0].appendChild(style);
}
);
};
browser.addMockModule('disableNgAnimate', disableNgAnimate);
browser.addMockModule('disableCssAnimate', disableCssAnimate);
browser.driver.manage().window().setSize(1600, 1280);
}
};
this is in protractor config
{
"webdriverVersions": {
"selenium": "2.51.0",
"chromedriver": "2.25",
"iedriver": "2.51.0"
}
}
it was not 2.25 i updated but still same.
I changed chrome driver and selenium driver to latest and it worked.

Resources