PeformUpkeep does not execute when checkUpkeep returns true using Chainlink automation - solidity

We are using a custom logic automation. when checking checkUpkeep the boolean returns true (pic attached) but our perform upkeep doesn't run. It is calling another function to run that cost rougly 50k to 100k in gas (when run manually) What are we missing? (p.s. when we do a simple toggle function call the performUpkeep works - but not our function). I've even put the gas up to 2,500,000 for testing using a timebased option as well (calling a specific function to execute same logic). Here is the repo https://github.com/billyjitsu/expir3/tree/main/packages/backend/contracts
WE are expecting when the checkUpkeep returns true to execute the upkeep

In order to solve the problem like "Why Chainlink checkUpkeep does not execute", I suggest doing the following things to debug your upkeep.
Since checkUpkeep and performUpkeep are both triggered by Chainlink automation, you need to check your automation subscription first. In the automation app, double check the contract address is correct.
Because the chainlink node has to change the state of blockchain(call performUpkeep in your consumer contract), it has to pay the gas fee. It is important to make sure there is a minimum balance of LINK in your subscription.
Test if checkUpkeep works as expected. If the pre-defined condition for automation is satisfied in your smart contract, checkUpkeep should return true. Chainlink automation only calls performUpkeep when checkUpkeep returns true, so the upkeep does not work if checkUpkeep cannot return true. Call checkUpkeep by yourself to test if it works properly. If you cannot get true as returned value, automation cannot get true either.
Test if performUpkeep works as expected. The mechanism of Chainlink automation is to call performUpkeep when checkUpkeep returns true, so you must make sure the performUpkeep can be called by automation. Try to call the performUpkeep manually to see if it works properly.
Hope it helps!

Related

Ember -- component integration async tests aren't waiting until async calls are returned

I'm having a hard time testing async functionality in component integration tests. Input kicks off an async call to an endpoint, and when it returns, I send an action. I'm trying to test that the action sends the correct data.
I've tried putting my assertion in the wait() helper, but the assertion gets hit before the (dependent upon async) action is called.
Here's a twiddle showing that problem: https://ember-twiddle.com/79f9a80c639b642e538803ac64a1cf9d?openFiles=tests.integration.components.test-comp-test.js%2Ctemplates.components.test-comp.hbs
How can I correctly code my async component integration tests?
There are two things that fails your test:
Firstly, never make use of setTimeout (window.setTimeout) to schedule some future work with Ember. Make use the Ember way of doing it; I mean Ember.run.later. For the same thing that happened to me with acceptance tests; please see the following question and look through comments on the answer. The reason is that; Ember's test helpers really cannot handle setTimeout as we expect it.
You have a problem within the test itself; in the action handler you have written in test you need to change the name attribute instead of returning a promise.
Anyway please see the following twiddle I have updated. Testing in general with Ember is kind of a pain; since I believe there is not a proper comprehensive documentation. Good luck!

How do I see the contract log events in Ethereum?

I finished the https://www.ethereum.org/crowdsale tutorial in Ethereum and intentionally left the crowdsale having failed its funding goal (sample code at the start of the page). I fired the "safeWithdrawal" function from within Ethereum-Wallet and it adds the transaction on to the blockchain. But at this point I do not know how to listen to the response. The ether I sent was not returned.
I would like the ether to be returned.
I would like to know how to listen to the event that should have fired. Or any feedback mechanism to know that the why / how the event fired.
Screenshot: http://i.stack.imgur.com/2lsVo.png
Currently, the Ethereum-Wallet has no debugger built-in for smart contracts.
I suggest, you code up your example using the browser-solidity. It allows you not only to code and test the deployment but got most recently a debugger built in. Click the little bug.
The debugger used in browser solidity is remix which is both a javascript IDE but also a library which can be attached to your own javascript projects. It is possible that future releases of Ethereum-Wallet will also include remix, this would simplify your task pretty much.
But for now, the mentioned browser tool seems like perfectly suited for your needs.

SoapUI with Groovy Script calling multiple APIs

I am using SoapUI with Groovy script and running into an issue when calling multiple APIs. In the system I am testing one WSDL/API handles the account registration, and returns an authenticator. I then use that returned authenticator to call a different WSDL/API and verify some information. I am able to call each of these WSDLs/APIs separate but when I put them together in a Groovy Script it doesn't work.
testRunner.runTestStepByName("RegisterUser");
testRunner.runTestStepByName("Property Transfer");
if(props.getPropertyValue("userCreated") == "success"){
testRunner.runTestStepByName("AuthenticateStoreUser");
To explain the first line will run the TestStep "RegisterUser". I then do a "Property Transfer" step which takes a few response values from "RegisterUser" - the first is "Status" to see if it succeeded or failed, second is the "Authenticator". I then do an if statement to check if "RegisterUser" succeeded then attempt to call "AuthenticateStoreUser". At this point everything looks fine. Though when it calls "AuthenticateStoreUser" it shows the thinking bar then fails like a timeout, and if I check the "raw" tab for the request it says
<missing xml data>.
Note, that if I try the "AuthenticateStoreUser" by itself the call works fine. It is only after calling "RegisterUser" in the Groovy Script that it behaves strange. I have tried this with a few different calls and believe it is an issue calling two different APIs.
Has anyone dealt with this scenario, or can provide further direction to what may be happening?
(I would have preferred to simply comment on the question, but I don't have enough rep yet)
Have you checked the Error log tab at the bottom when this occurs? If so, what does it say and is there a stacktrace you could share?

How to simulate an app purchase in Windows 8 Store App development?

I am trying to simulate an app purchase for my unit test using the following code:
currentApp.requestAppPurchaseAsync(false);
It does return the S_OK code indicating a successful purchase but my unit test is failing because licenseInformation.isTrial is coming back as true.
I am under the impression that it should change the isTrial to false as I just purchased it.
Thoughts??
Try calling
await currentApp.requestAppPurchaseAsync(false);
My guess is that your unit test is continuing before the asynchronous method completes and the license is actually purchased.

How do I detect a test has failed in Selenium html test?

We have a bank of tests that all start by logging in.
They're recorded by QA so are html tests.
However occasionally something goes wrong and the tests fails. When
that happens the logout at the end of the test doesn't get called, so
the next test tries to login again - using open ./Login
If you're logged out that works fine.
However if you didn't log out because the test fails, that command puts you in a different path and then the rest of the tests in that suite all fail.
How do I tell Selenium to log out if the test fails?
Or how do I tell Selenium if LogOut link is available logout else
continue?
From My point of view i would prefer Following steps
create lib with all test cases. create Suite which will call the required function from libraries. In Suite use following flow
Call login
if login function returns zero call required function to execute.
If the called function returns zero call logout.
::::::::::::::::::::::::::::::::::::::::::::::::
If one of the function returns non zero store it in some variable or array with function name and error.
If want more details let me know.
e.g. if function gives error returns non zero value call errorLogout
You can used below approach:
Approach 1: TestNg annotation.
Approach 2. Use try catch block in catch block call logout function and then throw exception
Let me know if you need more explanation.