Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ssl upgrade test failures #170

Merged
merged 2 commits into from
May 28, 2019
Merged

Conversation

seriyps
Copy link
Collaborator

@seriyps seriyps commented May 27, 2019

There were 2 tests faling because of race-condition between user-generated message and inet driver message:

  1) smtp_socket:ssl_upgrade_test_/0: TCP connection can be upgraded to ssl                                                                                                                                                     
     Failure/Error: ?assertMatch({ sslsocket , _ , _ }, NewServerSocket)                                         
       expected: = { sslsocket , _ , _ }                                                                                                                                                                                        
            got: {inet_async,#Port<0.397>,1,{error,closed}}                                                                                                                                                                     
     %% eunit_proc.erl:325:in `eunit_proc:with_timeout/3`                                                                
     Output:  
  2) smtp_socket:ssl_upgrade_test_/0: SSL client connection can't be upgraded again                                                                                                                                             
     Failure/Error: {error,function_clause,                                                                                                                                                                                     
                        [{ssl,close,                                                                                                                                                                                            
                             [{inet_async,#Port<0.401>,1,{error,closed}}],                                                                                                                                                      
                             [{file,"ssl.erl"},{line,294}]},                                                                                                                                                                    
                         {eunit_test,run_testfun,1,                                                                                                                                                                             
                             [{file,"eunit_test.erl"},{line,71}]},                                               
                         {eunit_proc,run_test,1,                                                                                                                                                                                
                             [{file,"eunit_proc.erl"},{line,510}]},                                                                                                                                                             
                         {eunit_proc,with_timeout,3,                                                                     
                             [{file,"eunit_proc.erl"},{line,335}]},                                                                                                                                                             
                         {eunit_proc,handle_test,2,                                                                                                                                                                             
                             [{file,"eunit_proc.erl"},{line,493}]},                                                                                                                                                              
                         {eunit_proc,tests_inorder,3,                                                                                                                                                                           
                             [{file,"eunit_proc.erl"},{line,435}]},                                                                                                                                                             
                         {eunit_proc,with_timeout,3,                                                                                                                                                                             
                             [{file,"eunit_proc.erl"},{line,325}]},                                                                                                                                                             
                         {eunit_proc,run_group,2,                                                                                                                                                                               
                             [{file,"eunit_proc.erl"},{line,549}]}]} 

Now fixed by using selective receive.

Is there any chance Travis builds will be enabled for gen_smtp?

@arjan
Copy link
Collaborator

arjan commented May 28, 2019

I still have two failures on this branch:

  1) socket:ssl_upgrade_test_/0: TCP connection can be upgraded to ssl
     Failure/Error: ?assertMatch({ sslsocket , _ , _ }, NewServerSocket)
       expected: = { sslsocket , _ , _ }
            got: {ssl_closed,
                     {sslsocket,
                         {gen_tcp,#Port<0.418>,tls_connection,<0.674.0>},
                         [<0.679.0>,<0.677.0>]}}=ERROR REPORT==== 28-May-2019::16:51:28.318775 ===

and:

  2) socket:ssl_upgrade_test_/0: SSL client connection can't be upgraded again
     Failure/Error: {error,function_clause,
                        [{ssl,close,
                             [{inet_async,#Port<0.438>,1,{error,closed}}],
                             [{file,"ssl.erl"},{line,596}]},
                         {eunit_test,run_testfun,1,
                             [{file,"eunit_test.erl"},{line,71}]},
                         {eunit_proc,run_test,1,
                             [{file,"eunit_proc.erl"},{line,510}]},
                         {eunit_proc,with_timeout,3,

Should this PR address these issues?

@arjan
Copy link
Collaborator

arjan commented May 28, 2019

By the way, I'm +1 to enable Travis but the repo owner @Vagabond needs to enable this, IIRC.

@mworrell
Copy link
Collaborator

Indeed, only @Vagabond can enable Travis builds (or maybe add someone else as an extra owner)

@seriyps
Copy link
Collaborator Author

seriyps commented May 28, 2019

@arjan this is super strange, because these two are exactly the issues that were addressed in this PR. Are you 100% sure you are on the correct branch and that you don't have some build artifacts left from previous runs? Can you, please, try to remove _build directory before doing make test?

@arjan
Copy link
Collaborator

arjan commented May 28, 2019

You are right, I'm sorry, I had to rebuild. Thanks for fixing this!

@arjan arjan merged commit ae1d5d7 into gen-smtp:master May 28, 2019
@seriyps seriyps mentioned this pull request Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants