Skip to content

Commit

Permalink
Adjusted the while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Jan 16, 2025
1 parent f7a5ef0 commit eee9c0a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,16 +757,16 @@ async def storm_webdav_state(state, condition, user):
should_start_sw = False
logger.info("Assesing the state of the storm webdav instance for user %s", user)
async with condition:
if user not in state:
state[user] = "NOT_RUNNING"
logger.info(
"Currently, there is no storm webdav instance running for user %s", user
)
while not (state[user] == "NOT RUNNING" or state[user] == "RUNNING"):
if user not in state:
state[user] = "NOT_RUNNING"
logger.info(
"Currently, there is no storm webdav instance running for user %s", user
)

if state[user] == "NOT_RUNNING":
state[user] = "STARTING"
condition.notify()
logger.info("Storm webdav instance for user %s is starting now.", user)
should_start_sw = True

elif state[user] == "RUNNING":
Expand Down Expand Up @@ -811,7 +811,11 @@ async def storm_webdav_state(state, condition, user):
"created_at": datetime.datetime.now(),
"last_accessed": str(datetime.datetime.now()),
}
logger.info("StoRM-WebDAV instance for user %s is now running on port %d", user, port)
logger.info(
"StoRM-WebDAV instance for user %s is now starting on port %d",
user,
port,
)
return port

else:
Expand Down Expand Up @@ -885,7 +889,7 @@ async def _return_or_create_storm_instance(sub):
STARTUP_TIMEOUT,
)

logger.info(
logger.debug(
"Storm-WebDAV instance for %s started on port %d.",
local_user,
port,
Expand Down

1 comment on commit eee9c0a

@vrbanecd
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
16 16 0 32 50.00 653.151ms

Passed Tests

Name ⏱️ Duration Suite
GET NO TOKEN 0.010 s Teapot-Tests
GET INVALID TOKEN 0.036 s Teapot-Tests
PUT REQUEST INVALID TOKEN 0.010 s Teapot-Tests
PUT REQUEST NO TOKEN 0.009 s Teapot-Tests
GET FILE NO TOKEN 0.009 s Teapot-Tests
GET FILE INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN 0.009 s Teapot-Tests
GET NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET INVALID TOKEN EXTRA_AREA 0.008 s Teapot-Tests
PUT REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET FILE NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests
GET FILE INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
DELETE REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests

Failed Tests

Name Message ⏱️ Duration Suite
GET USER1 Url: https://teapot:8081/default_area Expected status: 500 != 200 0.171 s Teapot-Tests
GET USER2 Url: https://teapot:8081/default_area Expected status: 500 != 200 0.093 s Teapot-Tests
PUT REQUEST USER1 Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 204 0.020 s Teapot-Tests
PUT REQUEST USER2 Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile1 Expected status: 500 != 204 0.022 s Teapot-Tests
GET FILE USER1 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 204 0.020 s Teapot-Tests
GET FILE USER2 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 204 0.020 s Teapot-Tests
DELETE REQUEST USER1 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 0.010 s Teapot-Tests
DELETE REQUEST USER2 Setup failed: Url: https://teapot:8081/default_area/TestFile2 Expected status: 500 != 201 0.010 s Teapot-Tests
GET USER1 EXTRA_AREA Url: https://teapot:8081/extra_area Expected status: 500 != 200 0.009 s Teapot-Tests
GET USER2 EXTRA_AREA Url: https://teapot:8081/extra_area Expected status: 500 != 200 0.010 s Teapot-Tests
PUT REQUEST USER1 EXTRA_AREA Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 204 0.019 s Teapot-Tests
PUT REQUEST USER2 EXTRA_AREA Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile1 Expected status: 500 != 204 0.018 s Teapot-Tests
GET FILE USER1 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 204 0.019 s Teapot-Tests
GET FILE USER2 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 Also teardown failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 204 0.020 s Teapot-Tests
DELETE REQUEST USER1 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 0.010 s Teapot-Tests
DELETE REQUEST USER2 EXTRA_AREA Setup failed: Url: https://teapot:8081/extra_area/TestFile2 Expected status: 500 != 201 0.011 s Teapot-Tests

Please sign in to comment.