-
Notifications
You must be signed in to change notification settings - Fork 217
Istiocdxaction #1771
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
Istiocdxaction #1771
Conversation
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) | ||
@DisplayName("Verify cross domain transaction with istio enabled is successful") | ||
@IntegrationTest | ||
public class ItIstioCrossDomainTransaction implements LoggedTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no more implements LoggedTest
Please see PR #1765
Now you need to get logger here and initialize it in initAll method.
private static LoggingFacade logger = null;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, sync'd a few minutes ago and was working on changing this.
done.
/** | ||
* Install Operator. | ||
* @param namespaces list of namespaces created by the IntegrationTestWatcher by the | ||
* JUnit engine parameter resolution mechanism |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now a simple description is good enough I guess
* JUnit engine parameter resolution mechanism | |
@param namespaces injected by JUnit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
*/ | ||
@BeforeAll | ||
public static void initAll(@Namespaces(3) List<String> namespaces) { | ||
// create standard, reusable retry/backoff policy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need logger initialized here
logger = getLogger();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
installIstio(); | ||
|
||
// get a new unique opNamespace | ||
logger.info("Creating unique namespace for Operator"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.info("Creating unique namespace for Operator"); | |
logger.info("Assigning a unique namespace for Operator"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
assertNotNull(namespaces.get(0), "Namespace list is null"); | ||
opNamespace = namespaces.get(0); | ||
|
||
logger.info("Creating unique namespace for Domain"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@Test | ||
@DisplayName("Check cross domain transaction with istio works") | ||
@Slow | ||
@MustNotRunInParallel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these 2 tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to keep it there for now. There is an issue with the istio service port number which might cause a problem if the istio tests are run in parallel. Will remove it later after that issue is resolved..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MustNotRunInParallel tag may not help. We need find other solution such as adding host name to the istio service to provide host information in http header.
logger.info("\n HTTP response is \n " + result.stdout()); | ||
logger.info("curl command returned {0}", result.toString()); | ||
assertTrue(result.stdout().contains("Status=Committed"), "crossDomainTransaction failed"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to use java based http client?
String url= String.format("
"http://%s:%s/TxForward/TxForward?urls=t3://%s.%s:7001,t3://%s1.%s:8001,t3://%s1.%s:8001,"
+ "t3://%s2.%s:8001",
K8S_NODEPORT_HOST, istioIngressPort, domain1AdminServerPodName, domain1Namespace,
domain1ManagedServerPrefix, domain1Namespace, domain2ManagedServerPrefix,domain2Namespace,
domain2ManagedServerPrefix,domain2Namespace);
HttpResponse response = assertDoesNotThrow(() -> OracleHttpClient.get(url, true));
assertEquals(200, response.statusCode(), "Status code not equals to 200");
assertTrue(response.body().contains(""Status=Committed"), "crossDomainTransaction failed");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to use the http client
logger.info("Check for managed server pod {0} existence in namespace {1}", | ||
managedServerPrefix + i, domainNamespace); | ||
checkPodExists(managedServerPrefix + i, domainUid, domainNamespace); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need the podExists checks because podReady will do both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has to be in this order.
- admin service check
- admin pod ready check
- ms service check
- ms pod ready check
logger.info("Check managed server service {0} is created in namespace {1}", | ||
managedServerPrefix + i, domainNamespace); | ||
checkServiceExists(managedServerPrefix + i, domainNamespace); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkServiceExists should be done before checkPodReady
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved it up.
}, "Access to admin server node port failed"); | ||
assertTrue(loginSuccessful, "Console login validation failed"); | ||
|
||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more change needed
logger.info("Check for managed server pod {0} existence in namespace {1}", | ||
managedServerPrefix + i, domainNamespace); | ||
checkPodExists(managedServerPrefix + i, domainUid, domainNamespace); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has to be in this order.
- admin service check
- admin pod ready check
- ms service check
- ms pod ready check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
import java.io.FileInputStream; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
//import java.net.http.HttpResponse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
int istioIngressPort = getIstioHttpIngressPort(); | ||
logger.info("Istio Ingress Port is {0}", istioIngressPort); | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove any unnecessary code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove extra spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to get the test to pass on Kind cluster and tried to see if retry works. Didn't want to remove the commented code till I found the solution. Finally passed in kind cluster. So, removed all commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving. Before commit, please do remove any commented out imports or code and resolve the conflict.
Do not merge yet. |
istio: ingressgateway | ||
servers: | ||
- hosts: | ||
- '*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing Host information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
- match: | ||
- uri: | ||
prefix: /console | ||
- uri: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this uri prefix ? You are not using any REST API to configure domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean the management prefix. I guess not. Will remove it.
|
||
- match: | ||
- uri: | ||
prefix: /TxForward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only difference between this template and existing istio-http-template.yaml. We can make the application prefix as replaceable and use the same template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also want to prefix my hostname with the domain name and namespace - not to have conflicts later - if we have 2 domains in the same namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I have to deploy my app to the AS as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping it separate for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping it separate for now.
} | ||
|
||
/* | ||
* This test verifies cross domain transaction is successful. domain in image using wdt is used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testname should be modified to testIstioCrossDomainTransaction()
The description does not refers to ISTIO
The description should give more details about the transaction with description of control flow inside the application. This is the only document we refers when the test fails.
For example
- Configure two WebLogic Domain(s) with following transnational resources.
- Start a 2PC transaction
- Enlist a JDBC/JMS Resources from a Server on domain1
- Enlist a another transnational resource from domain2
- Commit the Transaction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the test name and added more description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Test to confirm cross domain transaction works when istio is enabled.