Skip to content

Commit

Permalink
Merge pull request #645 from ayeshLK/master
Browse files Browse the repository at this point in the history
Restructure websub test cases to fix tests hanging issue
  • Loading branch information
ayeshLK committed Apr 2, 2024
2 parents a99530c + c1917a9 commit 8bb5a33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions ballerina-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "cache"
version = "3.7.0"
version = "3.7.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "constraint"},
Expand Down Expand Up @@ -66,7 +66,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.10.3"
version = "2.10.12"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -255,7 +255,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.2.0"
version = "1.2.2"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand Down
6 changes: 3 additions & 3 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "cache"
version = "3.7.0"
version = "3.7.1"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -64,7 +64,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.10.3"
version = "2.10.12"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -259,7 +259,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.2.0"
version = "1.2.2"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand Down
9 changes: 4 additions & 5 deletions ballerina/tests/unsubscription_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ isolated function notifySubscriber(string mode) returns error? {
}
}

listener Listener unsubscriptionTestListener = new (9102);

SubscriberService unsubscriptionTestSubscriber = @SubscriberServiceConfig {
target: ["http://127.0.0.1:9197/common/hub", "test"],
leaseSeconds: 36000,
Expand All @@ -87,12 +85,13 @@ service object {
groups: ["unsubscriptionViaGracefulstop"]
}
function testUnsubscriptionOnGracefulStop() returns error? {
check unsubscriptionTestListener.attach(unsubscriptionTestSubscriber, "sub");
check unsubscriptionTestListener.'start();
Listener ls = check new (9102);
check ls.attach(unsubscriptionTestSubscriber, "sub");
check ls.'start();
log:printInfo("[UNSUB_VER] Starting Subscriber");
runtime:sleep(5);
log:printInfo("[UNSUB_VER] Invoking graceful stop");
check unsubscriptionTestListener.gracefulStop();
check ls.gracefulStop();
runtime:sleep(5);
log:printInfo("[UNSUB_VER] Verifying shutdown");
test:assertTrue(isVerified());
Expand Down

0 comments on commit 8bb5a33

Please sign in to comment.