Skip to content

Commit

Permalink
changed the position of condition.wait()
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Jan 16, 2025
1 parent 74f917f commit 710bea5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,10 @@ async def storm_webdav_state(state, condition, 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)
logger.info(
"Currently, there is no storm webdav instance running for user %s", user
)
while True:
await condition.wait()

if state[user] == "NOT_RUNNING":
state[user] = "STARTING"
condition.notify()
Expand All @@ -773,6 +773,8 @@ async def storm_webdav_state(state, condition, user):
)
should_start_sw = False
break
else:
await condition.wait()

if should_start_sw:
port = await _find_usable_port_no()
Expand Down

1 comment on commit 710bea5

@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
32 0 0 32 100 55.284722s

Passed Tests

Name ⏱️ Duration Suite
GET USER1 10.667 s Teapot-Tests
GET USER2 10.463 s Teapot-Tests
GET NO TOKEN 0.010 s Teapot-Tests
GET INVALID TOKEN 0.030 s Teapot-Tests
PUT REQUEST INVALID TOKEN 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN 0.009 s Teapot-Tests
PUT REQUEST USER1 2.194 s Teapot-Tests
PUT REQUEST USER2 2.177 s Teapot-Tests
GET FILE USER1 3.186 s Teapot-Tests
GET FILE USER2 3.191 s Teapot-Tests
GET FILE NO TOKEN 0.009 s Teapot-Tests
GET FILE INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST USER1 2.115 s Teapot-Tests
DELETE REQUEST USER2 2.138 s Teapot-Tests
DELETE REQUEST INVALID TOKEN 0.012 s Teapot-Tests
DELETE REQUEST NO TOKEN 0.011 s Teapot-Tests
GET USER1 EXTRA_AREA 2.103 s Teapot-Tests
GET USER2 EXTRA_AREA 2.114 s Teapot-Tests
GET NO TOKEN EXTRA_AREA 0.010 s Teapot-Tests
GET INVALID TOKEN EXTRA_AREA 0.010 s Teapot-Tests
PUT REQUEST INVALID TOKEN EXTRA_AREA 0.011 s Teapot-Tests
PUT REQUEST NO TOKEN EXTRA_AREA 0.011 s Teapot-Tests
PUT REQUEST USER1 EXTRA_AREA 2.122 s Teapot-Tests
PUT REQUEST USER2 EXTRA_AREA 2.113 s Teapot-Tests
GET FILE USER1 EXTRA_AREA 3.157 s Teapot-Tests
GET FILE USER2 EXTRA_AREA 3.152 s Teapot-Tests
GET FILE NO TOKEN EXTRA_AREA 0.012 s Teapot-Tests
GET FILE INVALID TOKEN EXTRA_AREA 0.008 s Teapot-Tests
DELETE REQUEST USER1 EXTRA_AREA 2.095 s Teapot-Tests
DELETE REQUEST USER2 EXTRA_AREA 2.117 s Teapot-Tests
DELETE REQUEST INVALID TOKEN EXTRA_AREA 0.010 s Teapot-Tests
DELETE REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests

Please sign in to comment.