Trainees experience significant stress in the operating room, with potentially adverse effects on performance and learning. Psychological resilience explains why some individuals excel despite significant stress, meeting challenges with optimism and flexibility. The purpose of this study was to explore the relationships between trainee resilience, intraoperative stress, and desire to leave residency training. Qualitative focus groups and a literature review were used to develop a new instrument to assess Surgical TRainee Experiences of StresS in the Operating Room (STRESSOR). STRESSOR was used in a survey of Canadian surgical residents to assess trainee stress. Resiliency was measured using the 10-item Connor-Davidson Resiliency Scale (CD-RISC-10). The survey was distributed nationally and 171 responses were collected for a 36% response rate. The greatest sources of intraoperative stress were time pressure, attending temperament, and being interrupted by a pager. The STRESSOR instrument had strong reliability (Cronbach's α=0.92) and demonstrated good construct validity using confirmatory factor analysis. The mean CD-RISC-10 score was 28.8, which is similar to that of Canadian medical students. Resilience was protective against intraoperative stress (R2=0.16, p<0.001). Residents with higher stress or lower resilience were more likely to have seriously considered leaving their training program (Spearman's rho = 0.42, p<0.001). Screening for resilience may assist in selecting trainees who are better able to manage stress during surgery and reduce resident attrition. Resiliency training may help learners manage the high stress environment of the operating room, potentially improving surgical performance and learning in the next generation of surgeons.