Homework 0 forum

Problem with online tests

 
Picture of Mert Soydinç
Problem with online tests
by Mert Soydinç - Friday, 2 October 2020, 17:35
 

Hello, 

I have encountered a weird problem. All the local tests are passing without a problem but then I push the code on to the Gitlab and run the test there, I get bind: address already in use error while opening the udp listening connection(this only happens for TestGossip_ChainSplit). Do you have any advice?

Picture of Mert Soydinç
Re: Problem with online tests
by Mert Soydinç - Friday, 2 October 2020, 18:12
 

I think I should add that Gitlab tests also sometimes pass(generally 1 passes for every 4 tries).

Picture of Utku Görkem Ertürk
Re: Problem with online tests
by Utku Görkem Ertürk - Saturday, 3 October 2020, 13:11
 

Hi,

I had the same issue. This is most probably race condition that is caused by stop function. The main function ends before the child routine stops the connection so the port is still open. You should wait for connection termination in the stop function before returning from the function.


Picture of Mert Soydinç
Re: Problem with online tests
by Mert Soydinç - Saturday, 3 October 2020, 18:05
 
Oh I think you are right. I have forgotten that other routines also return when the main routine returns. Thank you!