Skip to content

Commit

Permalink
Work around dotnet#7371
Browse files Browse the repository at this point in the history
- Don't have a threading contention for stdout by only using stdout in the exception case; "starting..." adds minimal value, one can assume if the script is called it starts.
- sleep the main thread 2s before accessing stdout in case the exception case wants to happen
  • Loading branch information
MattGal committed May 28, 2021
1 parent 0289da4 commit 5e746f3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import re
import sys
import time
import traceback
import logging
from queue import Queue
Expand Down Expand Up @@ -39,7 +40,6 @@ def __process(self, batch):

def run(self):
global workerFailed, workerFailedLock
self.__print("starting...")
while True:
try:
item = self.queue.get()
Expand Down Expand Up @@ -146,6 +146,7 @@ def main():
worker.daemon = True
worker.start()

time.sleep(2000)
log.info("Beginning to read test results...")

# In case the user puts the results in HELIX_WORKITEM_UPLOAD_ROOT for upload, check there too.
Expand Down

0 comments on commit 5e746f3

Please sign in to comment.